Lubor
Lubor

Reputation: 999

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.

I have 30 classes (or labels) now and I have converted them to integers (0 - 29). Then I run xgboost() method from XGBOOST package on the data set. After building the model, I use predict() method to predict a new test data. Finally, I got a vector of numbers as the final output. BTW, all the numbers are between 0 and 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

Upvotes: 1

Views: 1281

Answers (1)

Lubor
Lubor

Reputation: 999

I just got it! The output is a matrix of 100,000*30 values. So every 30 numbers are corresponding to one specific instance, which means each number is the probability of that instance to be the label.

For example:

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

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

matrix[33]=Prob(instance1==label3)

Upvotes: 3

Related Questions