XGBoost:为什么在 XGBoost 中训练错误减少时测试错误增加?

XGBoost: why does test error increase when train error decreases in XGBoost?

当我用 xgboost 训练模型时,我发现 "eval-merror" 正在增加而 "train-merror" 正在减少,如下所示;是不是有什么错误?

enter image description here

你可能过拟合了。您是否尝试过设置 early_stopping_rounds?一旦 xgboost 检测到验证错误正在增加,这将终止训练。

如果从第一个训练步骤开始就出现这种行为,您可能想尝试较小的学习率(称为 eta)。

您可以在 api 参考资料中找到有关刚才提到的参数的更多信息:http://xgboost.readthedocs.io/en/latest/python/python_api.html