*Fix XGBClassifier super()

This commit is contained in:
white1033 2015-04-05 21:15:09 +08:00
parent 93d3f4fe61
commit 402e832ce5

View File

@ -792,7 +792,7 @@ class XGBModel(BaseEstimator):
class XGBClassifier(XGBModel, ClassifierMixin): class XGBClassifier(XGBModel, ClassifierMixin):
def __init__(self, max_depth=3, learning_rate=0.1, n_estimators=100, silent=True): def __init__(self, max_depth=3, learning_rate=0.1, n_estimators=100, silent=True):
super().__init__(max_depth, learning_rate, n_estimators, silent, objective="binary:logistic") super(XGBClassifier, self).__init__(max_depth, learning_rate, n_estimators, silent, objective="binary:logistic")
def fit(self, X, y, sample_weight=None): def fit(self, X, y, sample_weight=None):
y_values = list(np.unique(y)) y_values = list(np.unique(y))