Merge pull request #473 from evilmucedin/master
make XGBClassifier.score compatible with arrays
This commit is contained in:
commit
f025488294
@ -319,7 +319,7 @@ class XGBClassifier(XGBModel, XGBClassifierBase):
|
|||||||
if len(class_probs.shape) > 1:
|
if len(class_probs.shape) > 1:
|
||||||
column_indexes = np.argmax(class_probs, axis=1)
|
column_indexes = np.argmax(class_probs, axis=1)
|
||||||
else:
|
else:
|
||||||
column_indexes = np.repeat(0, data.shape[0])
|
column_indexes = np.repeat(0, class_probs.shape[0])
|
||||||
column_indexes[class_probs > 0.5] = 1
|
column_indexes[class_probs > 0.5] = 1
|
||||||
return self._le.inverse_transform(column_indexes)
|
return self._le.inverse_transform(column_indexes)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user