XGBoost - 帮助解释助推器行为。为什么第 0 次迭代总是最好的?
XGBoost- Help interpreting the booster behaviour. Why is the 0th iteration always coming out to be best?
我正在训练 XGBoost 模型,但无法解释模型行为。
- early_stopping_rounds=10
- num_boost_round=100
- 数据集不平衡,有 458644 个 1 和 7975373 个 0
- 评估指标是 AUCPR
- 参数 = {'max_depth':6, 'eta':0.03, 'silent':1, 'colsample_bytree': 0.3,'objective':'binary:logistic', 'nthread':6, 'subsample':1, 'eval_metric':['aucpr']}
根据我对“early_stopping_rounds”的理解,在 test/evaluation 数据集的评估指标 (aucpr) 连续 10 轮没有观察到任何改进后,训练应该停止。然而,在我的例子中,即使评估数据集的 AUCPR 有明显改善,训练仍然在第 10 个提升阶段后停止。请参阅下面的培训日志。此外,当第 10 次迭代的 AUCPR 明显高于第 0 次迭代时,最佳迭代出现在第 0 次迭代中。
这是正确的吗?如果不是,可能出了什么问题?如果是,请纠正我对提前停止轮次和最佳迭代的理解。
非常有趣!!
所以结果是 early_stopping
看起来最小化(RMSE、对数损失等)和最大化(MAP、NDCG、AUC)- https://xgboost.readthedocs.io/en/latest/python/python_intro.html
当您使用 aucpr
时,它实际上是在尝试将其最小化 - 也许这是默认行为。
调用xgboost.train()
时尝试设置maximize=True
- https://github.com/dmlc/xgboost/issues/3712
我正在训练 XGBoost 模型,但无法解释模型行为。
- early_stopping_rounds=10
- num_boost_round=100
- 数据集不平衡,有 458644 个 1 和 7975373 个 0
- 评估指标是 AUCPR
- 参数 = {'max_depth':6, 'eta':0.03, 'silent':1, 'colsample_bytree': 0.3,'objective':'binary:logistic', 'nthread':6, 'subsample':1, 'eval_metric':['aucpr']}
根据我对“early_stopping_rounds”的理解,在 test/evaluation 数据集的评估指标 (aucpr) 连续 10 轮没有观察到任何改进后,训练应该停止。然而,在我的例子中,即使评估数据集的 AUCPR 有明显改善,训练仍然在第 10 个提升阶段后停止。请参阅下面的培训日志。此外,当第 10 次迭代的 AUCPR 明显高于第 0 次迭代时,最佳迭代出现在第 0 次迭代中。
非常有趣!!
所以结果是 early_stopping
看起来最小化(RMSE、对数损失等)和最大化(MAP、NDCG、AUC)- https://xgboost.readthedocs.io/en/latest/python/python_intro.html
当您使用 aucpr
时,它实际上是在尝试将其最小化 - 也许这是默认行为。
调用xgboost.train()
时尝试设置maximize=True
- https://github.com/dmlc/xgboost/issues/3712