Skip to content Skip to sidebar Skip to footer

How To Fix Valueerror: Multiclass Format Is Not Supported

This is my code and I try to calculate ROC score but I have a problem with ValueError: multiclass format is not supported. I'm already looking sci-kit learn but it doesn't help. In

Solution 1:

From the docs, roc_curve: "Note: this implementation is restricted to the binary classification task."

Are your label classes (y) either 1 or 0? If not, I think you have to add the pos_label parameter to your roc_curve call.

fprate, tprate, thresholds = roc_curve(test_Y, pred_y, pos_label='your_label')

Or:

test_Y = your_test_y_array  # these are either 1's or 0's
fprate, tprate, thresholds = roc_curve(test_Y, pred_y)

Post a Comment for "How To Fix Valueerror: Multiclass Format Is Not Supported"