python - xgb-wrapper 交叉验证 (xgb.cv) 的结果是什么?
问题描述
我无法理解 xgb.cv 的输出:1)它是一个 k 折还是最佳 k 折的结果?2) 在训练集和测试集上分割数据集的原则是什么——KFold 或 0.8/0.2?
当我运行代码时,我看到了计算过程。它在以最佳成绩提前停止回合后停止。
当然:#模型参数
num_parallel_tree = 1
subsample = 1
colsample_bytree = 0.4
objective = 'binary:logistic'
learning_rate = 0.05
eval_metric = 'auc'
max_depth = 10
min_child_weight = 4
n_estimators = 5000
seed = 7
#cross-validation parameters
nfold = 5
early_stopping_rounds = 5
bst_cv = xgb.cv(
param,
dtrain,
num_boost_round=n_estimators,
nfold = nfold,
early_stopping_rounds=early_stopping_rounds,
verbose_eval=True
)
results:
[0] train-auc:0.910342+0.0015485 test-auc:0.850442+0.00619299
[1] train-auc:0.956268+0.00132653 test-auc:0.893746+0.00973467
...
[24] train-auc:0.984302+0.000617268 test-auc:0.934326+0.00338043
然后 - 停止。
解决方案
推荐阅读
- javascript - AJAX 对象将 Null 传递给控制器
- ios - 删除 SwiftUI 表单填充
- android - 滚动动画到达顶部时折叠工具栏不展开
- pandas - 大熊猫给定条件的年度聚合
- pandas - 将一个数据帧中的列值映射到另一个数据帧的索引并提取值
- android - AAPT:错误:资源“attr/orientation”的重复值与配置“”
- ocaml - ocaml 列表中的最大 int
- react-native - 在本机反应中使用 opencv.js
- asp.net-core - 异常后 Application Insights RequestTelemetry 未显示在请求中
- node.js - PassportJS Google oauth2.0 登录/注册