I have a tagged csv file with 5 calsses. I accidentally trained am XGBOOST model with this input but forgot to change the num_classes to 5, but instead it was still 2.

The model I received seems to be a very good one, I have tested it on several data sets. I tried to correct the error and set it to 5, that produced a much worse model.

Does anyone know what is the behavior of the training in such a case? Because I cant really explain why my model is working that good.

Edit: we are using Confusion Metrix to determine how good is the model:

y_pred = randomized_mse.predict(X_test)

print(confusion_matrix(y_test, y_pred))

we set num_class": [2], when in fact we have 5 classes in the data set

  • 1
    $\begingroup$ How did you test it ? Namely, how did you test it on 5 classes if it predict on 2 ? $\endgroup$ – lcrmorin Feb 24 at 12:00
  • $\begingroup$ Could you provide some of your code? This SO question suggests training should break with wrong num_classes: stackoverflow.com/q/36086529/10495893 $\endgroup$ – Ben Reiniger Feb 24 at 12:50
  • $\begingroup$ @lcrmorin edited post $\endgroup$ – Amit Raz Feb 24 at 13:27
  • 1
    $\begingroup$ It still lack a lot of informations : how the two classes have been selected from the five in your "good" model (not the code you used, but the result what label are in those two classes you got ?). How do you measure performance on your "bad" model ? a 5*5 matrice ? And how do you compare that 5*5 matrice with a 2*2 ? $\endgroup$ – lcrmorin Feb 24 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.