From b9171d8f0baca7a8608221ad89da98496f52dd85 Mon Sep 17 00:00:00 2001 From: UncleLLD Date: Thu, 22 Feb 2024 17:34:12 +0800 Subject: [PATCH] [doc] Fix python docs (#10058) --- doc/python/callbacks.rst | 2 +- doc/python/sklearn_estimator.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python/callbacks.rst b/doc/python/callbacks.rst index 7cb257a81..6d8b43a11 100644 --- a/doc/python/callbacks.rst +++ b/doc/python/callbacks.rst @@ -36,7 +36,7 @@ inside iteration loop. You can also pass this callback function directly into X # Specify which dataset and which metric should be used for early stopping. early_stop = xgb.callback.EarlyStopping(rounds=early_stopping_rounds, metric_name='CustomErr', - data_name='Train') + data_name='Valid') booster = xgb.train( {'objective': 'binary:logistic', diff --git a/doc/python/sklearn_estimator.rst b/doc/python/sklearn_estimator.rst index 207b9fa30..1aaa340b1 100644 --- a/doc/python/sklearn_estimator.rst +++ b/doc/python/sklearn_estimator.rst @@ -62,7 +62,7 @@ stack of trees: .. code-block:: python early_stop = xgb.callback.EarlyStopping( - rounds=2, metric_name='logloss', data_name='Validation_0', save_best=True + rounds=2, metric_name='logloss', data_name='validation_0', save_best=True ) clf = xgb.XGBClassifier(tree_method="hist", callbacks=[early_stop]) clf.fit(X_train, y_train, eval_set=[(X_test, y_test)])