Week 2: Ungraded Lab - imbalanced confusion matrix proportions problem

I think matrix indexes should be reversed:

hi @mbergal , welcome to the course! I see what you meant.
Actually the confusion matrix shown in the course and the one created by sklearn have reverse axis for True label and predicted label.

And that’s why the code look reversed.


I ran this

and the proportion of misclassified cats is 10.44%. Seems a bit high. Shouldn’t it be:

The axes are reversed so for the proportion of misclassified cats, we look from the X axis, at cats label, and compare it to the Y axis (true label). In this case, we predicted (364+3508+45) times and incorrectly classify cats (45 (true label is birds)+364 (true label is dogs)) times. The ratio thus is (364+45)/ (364+3508+45) = 0.1044