【问题标题】:How to retrieve regularisation term from xgboost如何从 xgboost 中检索正则化项
【发布时间】:2020-08-27 20:20:54
【问题描述】:

为了评估偏差-方差权衡,我更喜欢绘制预测误差与训练估计器的复杂性的关系图。 error vs complexity plot

如果是 xgboost the documentation states that the complexity is taken as the regularisation term of the objective function。所以原则上应该很容易生成这样的情节。

但是,我不知道如何检索经过训练的模型的计算正则化项。我正在使用 Python scikit-learn API。

这个值在库中是否可用,还是应该在训练后重新计算?

【问题讨论】:

    标签: python machine-learning xgboost


    【解决方案1】:

    您不需要检索,而是需要设置正则化。正则化越低,模型越复杂,反之亦然。在 XGBoost 的情况下,正则化是 lambda (a link for the documentation)。

    您需要遍历l2 值列表,训练模型并计算训练和测试子集的误差。

    这里还有good article 如何调整 XGBoost 的正则化。

    【讨论】:

      猜你喜欢
      • 2018-11-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-04
      • 2018-09-06
      • 2013-02-06
      • 2020-01-31
      • 1970-01-01
      • 2016-06-29
      相关资源
      最近更新 更多