multilabel-indicator is not supported
is the error message I get, when trying to run:
confusion_matrix(y_test, predictions)
y_test
is a DataFrame
which is of shape:
Horse | Dog | Cat
1 0 0
0 1 0
0 1 0
... ... ...
predictions
is a numpy array
:
[[1, 0, 0],
[0, 1, 0],
[0, 1, 0]]
I've searched a bit for the error message, but haven't really found something I could apply. Any hints?
No, your input to
confusion_matrix
must be a list of predictions, not OHEs (one hot encodings). Callargmax
on youry_test
andy_pred
, and you should get what you expect.The confusion matrix takes a vector of labels (not the one-hot encoding). You should run