我怎么知道 XGBoost 的正类值和负类值是什么? [英] How can I know which is the positive class value and negative class value for XGBoost?

查看:25
本文介绍了我怎么知道 XGBoost 的正类值和负类值是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个不平衡的数据集,其中我有一个包含 2 个不同值的类变量:0 和 1.

I am working with an imbalanced dataset where I have a class variable of 2 different values: 0 and 1.

0"值的数量为 1000,1"值的数量为 3000.

The number of '0' values is 1000 and the number of '1' values is 3000.

对于 XGBClassifier、LGBMClassifier 和 CatBoostClassifier,我发现有一个名为scale_pos_weight"的参数.允许修改类值的权重:

For XGBClassifier, LGBMClassifier and CatBoostClassifier I found that there is a parameter called "scale_pos_weight" which enables to modify the weights of the class values:

scale_pos_weight = number_of_negative_values/number_of_positive_values

scale_pos_weight = number_of_negative_values / number_of_positive_values

我的问题是:我们怎么知道类变量的哪个值是正的,哪个是负的?

My question is: how can we know which value of class variable is positive and which negative?

推荐答案

对于二分类不平衡数据集,总是考虑对少数类(class 1)的正值和对多数类(class 0)的负值.

For binary classification imbalanced dataset, always consider positive value to the minority class (class 1) and negative values to the majority class (class 0).

但是您已经假设 0 类为少数类 &1 类作为多数类.

But you have assumed class 0 as minority class & class 1 as majority class.

默认值 scale_pos_weight=1 或 >1

By default value of scale_pos_weight=1 or > 1

这篇关于我怎么知道 XGBoost 的正类值和负类值是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆