Fix a small typo in sklearn.py that broke multiple eval metrics (#5341)
This commit is contained in:
@@ -34,7 +34,8 @@ def test_binary_classification():
|
||||
kf = KFold(n_splits=2, shuffle=True, random_state=rng)
|
||||
for cls in (xgb.XGBClassifier, xgb.XGBRFClassifier):
|
||||
for train_index, test_index in kf.split(X, y):
|
||||
xgb_model = cls(random_state=42).fit(X[train_index], y[train_index])
|
||||
clf = cls(random_state=42)
|
||||
xgb_model = clf.fit(X[train_index], y[train_index], eval_metric=['auc', 'logloss'])
|
||||
preds = xgb_model.predict(X[test_index])
|
||||
labels = y[test_index]
|
||||
err = sum(1 for i in range(len(preds))
|
||||
|
||||
Reference in New Issue
Block a user