I am making a confusion matrix with sci-kit learn with two different lists: gold_labels and predicted labels
cm = confusion_matrix(gold_labels, predicted_labels)
pl.matshow(cm) #I use pl to generate an image
pl.title('Confusion Matrix')
pl.ylabel('True label')
pl.xlabel('Predicted label')
pl.colorbar()
where gold labels/predicted labels looks something like this: (list of strings)
gold_labels =["hello", "apple".....]
predicted_labels=["hi", "apple"....]
The confusion matrix is generated and it looks beautiful but the labels are indices (0,1,2) and I can't tell if 0 maps to "hello" or "apple" So, I have two questions: 1) Is there a way to make the labels appear on the generated confusion matrix in pl 2) If not, how do I know what in my list of strings matches to its corresponding index