3

Relatively simple question. Looking at the objective documentation for xgboost, I see "multi:softmax" and "multi:softprob", but both are mutliclass which will only output one class. Is there any way to predict multiple labels using xgboost or would I be better off simply training multiple models for each individual label. For example, on sklearn, multilabel is supported by RandomForestClassifier, where when fitting, your input for the target array can be of the shape n samples x n labels.

To clarify: multiclass would be when you want to predict whether a student gets an A,B, or C while multilabel would be something like predicting whether the student got question 1,2,3, or 4 on the test right. (they can only receive one grade but they can correctly answer any combination of those questions correctly)

varun413
  • 141
  • 6

1 Answers1

0

I haven't found anything which is supported natively by xgboost. The only solution is to wrap it around sklearn.multioutput.MultiOutputClassifier which does the same thing. But the downside of this method is that you cannot leverage load_model and save_model from xgboost itself and must use something like joblib to dump and load the model (which is not backward compatible in terms of xgboost version).

Benjamin
  • 98
  • 8