machine-learning - Sagemaker XG-Boost(目标=reg :logistic) not working on highly imbalanced data set

标签 machine-learning logistic-regression xgboost amazon-sagemaker

我正在处理 AWS Sagemaker 上的信用欺诈数据集。数据集高度不平衡。其欺诈交易率仅为 0.1732%。我想使用 sagemaker 的 XG-Boost 将给定交易预测为欺诈 (1) 或非欺诈 (0)。当我将超参数中的目标函数设置为“multi:softmax”且类数 = 2 时,它给出了良好的结果,召回率为 85%。当我将目标函数设置为“reg:logistic”时,我的召回率为 0。它只是将每笔交易标记为非欺诈。 2 个类别的 Logistic 和 multi-softmax 不应该给出相同的答案吗?另外,在处理不平衡数据集时是否应该更改任何超参数的默认值? 谢谢

最佳答案

对于不平衡数据集,第一件事是确保少数标签示例的过度代表性。 XGBoost 使用参数 scale_pos_weight 对此进行了规定。

请参阅参数scale_pos_weight详细信息: https://xgboost.readthedocs.io/en/latest/parameter.html

关于machine-learning - Sagemaker XG-Boost(目标=reg :logistic) not working on highly imbalanced data set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58838805/

相关文章:

python - XGBoost 成对设置 - python

python - 如何预测 scikit-learn 中的时间序列?

azure - 如何配置YOLOv8 yaml文件来访问Azure上的blob存储数据集?

python-3.x - GLM 和带有 statsmodels 的 Logit 模型有什么区别?

python - 值错误 : multiclass-multioutput format is not supported using sklearn roc_auc_score function

python - 限制 XGBoost 使用的线程数

machine-learning - 如何使用 mobilenet 作为高分辨率图像的特征提取器?

java - 大规模机器学习

r - 在 R 中部署具有预定系数的逻辑回归模型

python - 从 XGBoost 保存树