Skip to content

Commit

Permalink
[python] fixed result shape in case of predict_proba with raw_score arg
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored and guolinke committed Nov 25, 2018
1 parent 0c4bb89 commit cc99f0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def predict_proba(self, X, raw_score=False, num_iteration=None,
"""
result = super(LGBMClassifier, self).predict(X, raw_score, num_iteration,
pred_leaf, pred_contrib, **kwargs)
if self._n_classes > 2 or pred_leaf or pred_contrib:
if self._n_classes > 2 or raw_score or pred_leaf or pred_contrib:
return result
else:
return np.vstack((1. - result, result)).transpose()
Expand Down

0 comments on commit cc99f0d

Please sign in to comment.