Confusion Matrix

Are you confused by the confusion matrix? This should help:



  • Each row represents an actual class.
  • Each column represents a predicted class.
  • For the rows and columns:
    • Start with 0 coz NO = 0.
    • End with 1 coz YES = 1.
    • i.e. think in ascending order (zero ➔ one).

Regarding each of the 4 elements in the confusion matrix:

  • True Positives (TP): These are cases in which we predicted yes (they have the disease), and they do have the disease.
  • True Negatives (TN): We predicted no, and they don't have the disease.
  • False Positives (FP): We predicted yes, but they don't actually have the disease. (Also known as a Type I error.)
  • False Negatives (FN): We predicted no, but they actually do have the disease. (Also known as a Type II error.)

Check out Kevin's Simple Guide to Confusion Matrix for more details.

If you enjoyed this post and want to buy me a cup of coffee...

The thing is, I'll always accept a cup of coffee. So feel free to buy me one.

Cheers! ☕️