4

Consider a binary classification problem with 0 labels denoting normal and 1 abnormal or rare. The number of instances with 0 classes are more in comparison to 1. In general,

1) Does 0 always refer to positive or a negative depending on what we define as a positive and negative? What if the labels are reversed?

2) Is there a particular order that the confusion matrix if displayed? If the confusion matrix is given as:

1   4
0   5

I got this confusion matrix in Matlab. How do I know that the first row is for class 0 or for class 1?

Srishti M
  • 471
  • 4
  • 9

2 Answers2

5

Adding to the answer above,

  1. The labeling totally depends on how you define it. You can define 0 as negative or as positive. However, for the sake of understanding and ease of readability, keep it meaningful.
  2. The instances that are correctly predicted are given by the diagonal.
    Here, '1' is True Negative or for the class labelled as 0 and '5' is True Positive or for the class labelled as 1.

If you find it difficult to interpret by a simple confusion matrix, you could plot it. Check out plotConfusion by MathWorks.

aathiraks
  • 704
  • 4
  • 12
2

1) It depends in what you define as positive and negative. Generally, and in particular in medicine, people tend to label $0$ as negatives and $1$ as positives, thus being $1$ the abnormal case. But this is completely arbitraty, you can do as you wish.

2) 0 are always displayed in the first row and column. That is, your model has classified one 0 correctly and 5 ones correctly.

David Masip
  • 6,136
  • 2
  • 28
  • 62