Merge branch 'master' of ssh://github.com/dmlc/xgboost
This commit is contained in:
commit
39f1da08d2
@ -935,8 +935,8 @@ class XGBClassifier(XGBModel, XGBClassifier):
|
|||||||
base_score, seed)
|
base_score, seed)
|
||||||
|
|
||||||
def fit(self, X, y, sample_weight=None):
|
def fit(self, X, y, sample_weight=None):
|
||||||
y_values = list(np.unique(y))
|
self.classes_ = list(np.unique(y))
|
||||||
self.n_classes_ = len(y_values)
|
self.n_classes_ = len(self.classes_)
|
||||||
if self.n_classes_ > 2:
|
if self.n_classes_ > 2:
|
||||||
# Switch to using a multiclass objective in the underlying XGB instance
|
# Switch to using a multiclass objective in the underlying XGB instance
|
||||||
self.objective = "multi:softprob"
|
self.objective = "multi:softprob"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user