Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

softmax vs softprob in xgboost #4904

Closed
shashi-netra opened this issue Sep 29, 2019 · 1 comment
Closed

softmax vs softprob in xgboost #4904

shashi-netra opened this issue Sep 29, 2019 · 1 comment

Comments

@shashi-netra
Copy link

The xgboost documentation describes softmax and softprob thus:

multi:softmax: set XGBoost to do multiclass classification using the softmax objective, you also need to set num_class(number of classes)

multi:softprob: same as softmax, but output a vector of ndata * nclass, which can be further reshaped to ndata * nclass matrix. The result contains predicted probability of each data point belonging to each class.

I am confused about the difference since when I run the predict_proba method with multiple rows (ndata say),I do get a ndata * nclass matrix output as well. From what I know, softmax calculates probability distribution over a vector of values. So not sure what softprob is doing differently.

Can someone clarify the difference? It's probably very subtle but escapes me

@trivialfis
Copy link
Member

softprob is outputting the probability for each class, softmax gives the most probable class id.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants