Confusion Matrix

from sklearn.metrics import confusion_matrix
C = "Cat"
A = "Ant"
B = "Bird"
true = [C, A, C, C, A, B]
pred = [A, A, C, C, A, C]
confusion_matrix(true, pred, labels=[A, B, C])
array([[2, 0, 0],
       [0, 0, 1],
       [1, 0, 2]])