Skip to content

Commit

Permalink
Reviewers' comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Oct 6, 2020
1 parent 581fe02 commit cc1ec18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/python/callbacks.rst
Expand Up @@ -34,15 +34,15 @@ this callback function directly into XGBoost:
# Specify which dataset and which metric should be used for early stopping.
early_stop = xgb.callback.EarlyStopping(rounds=early_stopping_rounds,
metric_name='PyError',
data_name='Train')
metric_name='PyError',
data_name='Train')
booster = xgb.train(
{'objective': 'binary:logistic',
'eval_metric': ['error', 'rmse'],
'tree_method': 'hist'}, D_train,
evals=[(D_train, 'Train'), (D_valid, 'Valid')],
feval=eval_error_metric,
feval=eval_error_metric,
num_boost_round=1000,
callbacks=[early_stop],
verbose_eval=False)
Expand Down
6 changes: 3 additions & 3 deletions python-package/xgboost/training.py
Expand Up @@ -9,7 +9,7 @@
from . import callback


def _configure_deprected_callbacks(
def _configure_deprecated_callbacks(
verbose_eval, early_stopping_rounds, maximize, start_iteration,
num_boost_round, feval, evals_result, callbacks, show_stdv, cvfolds):
# Most of legacy advanced options becomes callbacks
Expand Down Expand Up @@ -93,7 +93,7 @@ def _train_internal(params, dtrain,
rounds=early_stopping_rounds, maximize=maximize))
callbacks = callback.CallbackContainer(callbacks, metric=feval)
else:
callbacks = _configure_deprected_callbacks(
callbacks = _configure_deprecated_callbacks(
verbose_eval, early_stopping_rounds, maximize, start_iteration,
num_boost_round, feval, evals_result, callbacks,
show_stdv=False, cvfolds=None)
Expand Down Expand Up @@ -486,7 +486,7 @@ def cv(params, dtrain, num_boost_round=10, nfold=3, stratified=False, folds=None
rounds=early_stopping_rounds, maximize=maximize))
callbacks = callback.CallbackContainer(callbacks, metric=feval, is_cv=True)
else:
callbacks = _configure_deprected_callbacks(
callbacks = _configure_deprecated_callbacks(
verbose_eval, early_stopping_rounds, maximize, 0,
num_boost_round, feval, None, callbacks,
show_stdv=show_stdv, cvfolds=cvfolds)
Expand Down

0 comments on commit cc1ec18

Please sign in to comment.