简体   繁体   English

如何使用R中的xgboost包解释多类分类的输出?

[英]How to interpret the output of a multiclasses classification using xgboost package in R?

I am new to the package of XGBOOST, I would like to use it for a multi-classes classification problem. 我是XGBOOST包的新手,我想用它来解决多类分类问题。

I have 30 classes (or labels) now and I have converted them to integers (0 - 29). 我现在有30个类(或标签),我已将它们转换为整数(0 - 29)。 Then I run xgboost() method from XGBOOST package on the data set. 然后我从数据集上的XGBOOST包运行xgboost()方法。 After building the model, I use predict() method to predict a new test data. 构建模型后,我使用predict()方法来预测新的测试数据。 Finally, I got a vector of numbers as the final output. 最后,我得到了一个数字向量作为最终输出。 BTW, all the numbers are between 0 and 1. 顺便说一句,所有数字都在0到1之间。

So now how can I interpret the output? 那么现在我该如何解释输出呢? Is that the probability? 这是概率吗? But how can I know which class should be related to? 但是我怎么知道应该与哪个班级相关呢?

Thanks 谢谢

I just got it! 我刚拿到它! The output is a matrix of 100,000*30 values. 输出是100,000 * 30值的矩阵。 So every 30 numbers are corresponding to one specific instance, which means each number is the probability of that instance to be the label. 因此,每30个数字对应一个特定实例,这意味着每个数字是该实例作为标签的概率。

For example: 例如:

matrix[1] is the Prob(instance0==label0) matrix [1]是Prob(instance0 == label0)

matrix[32] is Prob(instance1==label1) matrix [32]是Prob(instance1 == label1)

matrix[33]=Prob(instance1==label3) 矩阵[33] =习题(INSTANCE1 == LABEL3)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM