Update Python documents. (#6376)

This commit is contained in:
Jiaming Yuan
2020-11-12 17:51:32 +08:00
committed by GitHub
parent c5645180a6
commit c90f968d92
4 changed files with 18 additions and 11 deletions

View File

@@ -14,15 +14,15 @@ print('running cross validation')
# std_value is standard deviation of the metric
xgb.cv(param, dtrain, num_round, nfold=5,
metrics={'error'}, seed=0,
callbacks=[xgb.callback.print_evaluation(show_stdv=True)])
callbacks=[xgb.callback.EvaluationMonitor(show_stdv=True)])
print('running cross validation, disable standard deviation display')
# do cross validation, this will print result out as
# [iteration] metric_name:mean_value
res = xgb.cv(param, dtrain, num_boost_round=10, nfold=5,
metrics={'error'}, seed=0,
callbacks=[xgb.callback.print_evaluation(show_stdv=False),
xgb.callback.early_stop(3)])
callbacks=[xgb.callback.EvaluationMonitor(show_stdv=False),
xgb.callback.EarlyStopping(3)])
print(res)
print('running cross validation, with preprocessing function')
# define the preprocessing function