What are different options for objective functions available in xgboost.XGBClassifier?

Venkatachalam picture Venkatachalam · Aug 22, 2017 · Viewed 24.1k times · Source

Apart from binary:logistic (which is the default objective function), Is there any other built-in objective function that can be used in xbgoost.XGBClassifier() ?

Answer

kawa picture kawa · Aug 23, 2017

That's true that binary:logistic is the default objective for XGBClassifier, but I don't see any reason why you couldn't use other objectives offered by XGBoost package. For example, you can see in sklearn.py source code that multi:softprob is used explicitly in multiclass case.

Moreover, if it's really necessary, you can provide a custom objective function (details here).