Fix Python typehint with upgraded mypy. (#7513)
This commit is contained in:
parent
70b12d898a
commit
6f8a4633b7
@ -1859,7 +1859,7 @@ class DaskXGBClassifier(DaskScikitLearnBase, XGBClassifierBase):
|
|||||||
vstack = update_wrapper(
|
vstack = update_wrapper(
|
||||||
partial(da.vstack, allow_unknown_chunksizes=True), da.vstack
|
partial(da.vstack, allow_unknown_chunksizes=True), da.vstack
|
||||||
)
|
)
|
||||||
return _cls_predict_proba(getattr(self, "n_classes_", None), predts, vstack)
|
return _cls_predict_proba(getattr(self, "n_classes_", 0), predts, vstack)
|
||||||
|
|
||||||
# pylint: disable=missing-function-docstring
|
# pylint: disable=missing-function-docstring
|
||||||
def predict_proba(
|
def predict_proba(
|
||||||
|
|||||||
@ -1442,9 +1442,7 @@ class XGBClassifier(XGBModel, XGBClassifierBase):
|
|||||||
iteration_range=iteration_range
|
iteration_range=iteration_range
|
||||||
)
|
)
|
||||||
# If model is loaded from a raw booster there's no `n_classes_`
|
# If model is loaded from a raw booster there's no `n_classes_`
|
||||||
return _cls_predict_proba(
|
return _cls_predict_proba(getattr(self, "n_classes_", 0), class_probs, np.vstack)
|
||||||
getattr(self, "n_classes_", None), class_probs, np.vstack
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@xgboost_model_doc(
|
@xgboost_model_doc(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user