xgboost 参数 scale_pos_weight 详解

本文详细解析xgboost中scale_pos_weight参数的作用,它用于处理样本不均衡问题,有助于训练收敛。虽然该参数对排序和AUC指标有帮助,但不适用于调整真实预测概率。通过实例说明,增大少数样本的学习率可能是实现平衡的方式。当以logloss为评价标准时,增大scale_pos_weight可能导致logloss增加;而以AUC为标准时,效果相反。这表明使用scale_pos_weight后,预测概率的准确性可能会降低。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

话不多说,首先让我们看官网对此参数的解读。
API 中这样说:

scale_pos_weight : float
      Balancing of positive and negative weights.

Parameter Tuning —— Handle Imbalanced Dataset 中这样说:

For common cases such as ads clickthrough log, the dataset is extremely imbalanced. This can affect the training of xgboost model, 
and there are two ways to improve it.
  If you care only about the ranking order (AUC) of your prediction
      Balance the positive and negative weights, via scale_pos_weight
      Use AUC for evaluation
  If you care about predicting the right probability
      In such a case, you cannot re-balance the dataset
      In such a case, set parameter max_delta_step to a finite number (say 1) will help con
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值