multiclass classification with xgboost in tidymodels

I have a couple general questions about using xgboost for multiclass classification in tidymodels. First, how exactly do the labels work? Do my current labels (factors) need to be converted to sequential numeric labels, or will a recipe preprocessor automatically do so? Also, does anything else need to be passed to the set_mode() function, or does "classification" cover both binary and multiclass classification? Thanks in advance!

parsnip does all of the data prep things required by xgboost so keep the outcome data as a factor.

It also handles the loss function so you only need to pass that in when you want to use a non-standard loss.

You will need to set the mode though (since this model works for multiple modes).

1 Like