Skip to content
Advertisement

ValueError: Classification metrics unable to handle multiclass

I am trying to build a object classification model, but when trying to print out the classification report it returned a value error. ValueError: Classification metrics can't handle a mix of multiclass and continuous-multioutput targets

This is my current code:

JavaScript
JavaScript
JavaScript

However, when I attempt to print out the classification report, it ran into this error:

JavaScript
JavaScript

Advertisement

Answer

Your problem is caused by the presence of continuous-multioutput target values in y_test_arg or Y_pred. I think this error was generated in the below code:

JavaScript

It would help if you rounded your predictions in Y_pred before calculating classification_report. You can see this question

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement