[论文解读] Imbalance-XGBoost: Leveraging Weighted and Focal Losses for Binary Label-Imbalanced Classification with XGBoost
本文介绍了 Imbalance-XGBoost,一个将加权交叉熵和焦点损失集成到 XGBoost 中的 Python 包,用于二元标签不平衡分类。通过推导并实现这些损失函数的一阶和二阶梯度,该方法在不平衡数据集上实现了优越性能,显著提升了原始 XGBoost 的 F1 分数和 MCC,尤其在高不平衡比率下表现更佳。
The paper presents Imbalance-XGBoost, a Python package that combines the powerful XGBoost software with weighted and focal losses to tackle binary label-imbalanced classification tasks. Though a small-scale program in terms of size, the package is, to the best of the authors' knowledge, the first of its kind which provides an integrated implementation for the two losses on XGBoost and brings a general-purpose extension on XGBoost for label-imbalanced scenarios. In this paper, the design and usage of the package are described with exemplar code listings, and its convenience to be integrated into Python-driven Machine Learning projects is illustrated. Furthermore, as the first- and second-order derivatives of the loss functions are essential for the implementations, the algebraic derivation is discussed and it can be deemed as a separate algorithmic contribution. The performances of the algorithms implemented in the package are empirically evaluated on Parkinson's disease classification data set, and multiple state-of-the-art performances have been observed. Given the scalable nature of XGBoost, the package has great potentials to be applied to real-life binary classification tasks, which are usually of large-scale and label-imbalanced.
研究动机与目标
- 解决 XGBoost 在二元标签不平衡分类任务中性能下降的问题。
- 在 XGBoost 框架中通过解析导数实现加权交叉熵和焦点损失函数。
- 为现实世界中的不平衡分类问题提供一种通用、可扩展的解决方案。
- 通过在多个基准数据集上的实证评估,证明所提出损失函数的有效性。
- 发布一个轻量级、开源的 Python 包,兼容 Scikit-learn 和 XGBoost。
提出的方法
- 通过使用推导出的一阶和二阶梯度,借助自定义损失框架将加权交叉熵和焦点损失函数集成到 XGBoost 中。
- 通过在 XGBoost 目标函数中引入类别加权或焦点损失项,使模型更严重惩罚少数类样本的误分类。
- 提供了两种损失函数一阶和二阶导数的解析推导,从而在梯度提升框架中实现高效优化。
- 该实现基于 XGBoost,依赖 NumPy 和 Scikit-learn,确保兼容性和易用性。
- 支持通过网格搜索进行超参数调优,并针对大规模数据集设计为可扩展。
- 采用五折交叉验证,在四个 UCI 基准数据集上评估了该方法,其不平衡比率逐步增加。
实验结果
研究问题
- RQ1将加权损失和焦点损失函数集成到 XGBoost 中,是否能显著提升其在二元标签不平衡分类任务中的性能?
- RQ2所推导出的损失函数一阶和二阶梯度,如何在 XGBoost 框架中实现有效优化?
- RQ3在高度不平衡的数据集上,该方法是否在 F1 分数和 Matthews 相关系数上优于原始 XGBoost?
- RQ4该方法在不同基准数据集上,随着不平衡比率的增加,性能如何变化?
- RQ5该包是否可在大规模、不平衡的真实世界数据应用中有效使用?
主要发现
- 在帕金森病数据集上,加权 XGBoost 和焦点 XGBoost 的 AUC 和 PR 曲线面积均高于原始 XGBoost,表明对少数类的检测能力更强。
- 在 ecoli 数据集(9:1 不平衡)上,加权 XGBoost 和焦点 XGBoost 将 F1 分数从原始 XGBoost 的 0.627 提升至 0.645,MCC 从 0.586 提升至 0.616。
- 在 arrhythmia 数据集(17:1 不平衡)上,加权 XGBoost 将 F1 分数从 0.627 提升至 0.681,MCC 从 0.605 提升至 0.665。
- 在 ozone 数据集(42:1 不平衡)上,加权 XGBoost 将 F1 分数从原始 XGBoost 的 0.144 提升至 0.268,焦点 XGBoost 提升至 0.180。
- 随着不平衡比率的增加,所提方法的性能增益愈发显著,尤其体现在 F1 分数和 MCC 指标上。
- 该包在全部五个数据集上均表现出具有竞争力的性能,并已发布于 PyPI 和 GitHub,表明其具备实际可用性和潜在采用价值。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。