TST: Added test for early stopping
This commit is contained in:
9
tests/python/test_early_stopping.py
Normal file
9
tests/python/test_early_stopping.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import xgboost as xgb
|
||||
|
||||
|
||||
X = digits['data']
|
||||
y = digits['target']
|
||||
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
|
||||
clf = xgb.XGBClassifier()
|
||||
clf.fit(X_train, y_train, early_stopping_rounds=10, eval_metric="auc",
|
||||
eval_set=[(X_test, y_test)])
|
||||
Reference in New Issue
Block a user