machine-learning - Lightgbm(或其他具有损失的二阶近似值的增强树实现)如何处理 L1 损失?

标签 machine-learning xgboost lightgbm boosting

我一直在尝试了解 Lightgbm Handless L1 是如何丢失的(MAE、MAPE、HUBER)

根据to this article ,分割期间的增益应仅取决于损失函数的一阶和二阶导数。这是因为 Lightgbm 使用损失函数的二阶近似,因此我们可以将损失近似如下

Approximation of the loss for a split

然而,对于 L1 损失,损失梯度的绝对值是恒定的,其粗麻布为 0。我也读过这篇文章来处理这个问题,for loss functions with hessian = 0 we should rather use 1 as the Hessian :

"For these objective function with first_order_gradient is constant, LightGBM has a special treatment for them: (...) it will use the constant gradient for the tree structure learning, but use the residual for the leaf output calculation, with percentile function, e.g. 50% for MAE. This solution is from sklearn, and is proven to work in many benchmarks."

但是,即使使用常量粗麻布对我来说也没有意义:例如,如果使用 MAE 时梯度是误差的符号,则平方梯度不会为我们提供信息。这是否意味着当梯度恒定时,LightGbm不使用二阶近似,而默认使用传统的梯度提升?

另一方面,当阅读有关 GOSS boosting 原版 lightgbm paper 的内容时

enter image description here

对于 GOSS boosting 策略,作者考虑了梯度总和的平方。我看到了与上面相同的问题:如果 MAE 的梯度是误差的符号,那么梯度的平方如何反射(reflect)增益?这是否意味着 GOSS 也不适用于具有恒定梯度的损失函数?

提前致谢,

最佳答案

我在 Lightgbm 存储库中询问了这个问题并得到了这个 answer :

Before this version, we use the second-order approximation, but its performance actually is not good. And we switch back to 1) use first-order gradient to find split point; 2) then use the median of residuals for leaf outputs, as shown in the above code.

看来 Lightgbm 将使用梯度下降来处理已经实现的 L1 损失。对于自定义损失函数,它仍然会尝试执行大约二阶操作。

关于machine-learning - Lightgbm(或其他具有损失的二阶近似值的增强树实现)如何处理 L1 损失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60137453/

相关文章:

python - 在 Python 中的 scipy/numpy 中计算 2D 矩阵的 z 分数

machine-learning - Batchnorm2d Pytorch - 为什么将 channel 数传递给 batchnorm?

matlab - 带有预计算内核的 libsvm : How do I compute the classification scores?

python - XGBoost/lightGBM 如何评估 ndcg 的排名任务?

r - lightgbm 中多类的自定义度量函数

python - 如何在lightGBM中设置metric输出的频率?

python - tensorflow中评估指标的含义

python - shap_values 和explainer.expected_value 的输出是什么?

python-3.x - 如何在 XGBooost 中使用 early_stopping_rounds 参数

r - 如何理解R包xgboost中的nfold和nrounds