R 中的 Xgboost Num_class
Xgboost Num_class in R
一个让我困惑的非常快速的问题。我是 r 和预测建模的新手,目前正在将 xgboost 用于二元分类模型。我对 num_class 参数有点困惑,因为当我将它设置为 1 时,我有一个正常的输出并且工作正常。但是,当它设置为 2 时,预测中的数据行会加倍,但奇怪的是准确度会提高。
对于二进制分类,参数应该是 1 还是 2,如果是 2,为什么我会得到双倍的行?
二分类不需要设置num_class。
如果您参考文档,您会发现 -
num_class set the number of classes. To use only with multiclass
objectives
multi:softmax set xgboost to do multiclass classification using the
softmax objective. Class is represented by a number and should be from
0 to num_class - 1.
一个让我困惑的非常快速的问题。我是 r 和预测建模的新手,目前正在将 xgboost 用于二元分类模型。我对 num_class 参数有点困惑,因为当我将它设置为 1 时,我有一个正常的输出并且工作正常。但是,当它设置为 2 时,预测中的数据行会加倍,但奇怪的是准确度会提高。 对于二进制分类,参数应该是 1 还是 2,如果是 2,为什么我会得到双倍的行?
二分类不需要设置num_class。
如果您参考文档,您会发现 -
num_class set the number of classes. To use only with multiclass objectives
multi:softmax set xgboost to do multiclass classification using the softmax objective. Class is represented by a number and should be from 0 to num_class - 1.