Following up from here: Converting a 1D array into a 2D class-based matrix in python I want to draw ROC curves for each of my 46 classes. I have 300 test samples for which I've run my classifier to make a prediction. y_test is the true classes, and y_pred is what my classifier predicted. Here's my code: from sklearn.metrics import confusion_matrix, roc_curve, auc from sklearn.preprocessing import label_binarize import numpy as np y_test_bi = label_binarize(y_test, classes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19,20,21,2,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,3,40,41,42,43