mugenheimer
mugenheimer

Reputation: 5

Xgboost Num_class in R

a very quick question that is confusing me. I'm new to r and predictive modelling and I'm currently using xgboost for a binary classification model. I'm a little confused about the num_class parameter in that when I set it on 1 I have a normal output and it works fine. However, when it is set to 2 it doubles the rows of data in the prediction but weirdly the accuracy improves. For binary classification is the parameter supposed to be 1 or 2 and if 2 why do I get double the rows?

Upvotes: 0

Views: 710

Answers (1)

Indi
Indi

Reputation: 1449

You dont need to set num_class for binary classification.

If you refer the docmentation , you'll find -

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.

Upvotes: 1

Related Questions