Hi… it’s been a while πŸ™‚
In this post I want to explain about confusion matrix. I need 3 days to understand this thing. But I will tell you all I know about confusion matrix.

WHAT IS IT?
Confusion matrix is a table that show the performance of an algorithm.

WHY WE USE IT?
In my opinion, it’s like a measurement unit to compare the performance of algorithm. For example, we want to compare algorithm A and B to classify Avocado and Pineapple. Confusion matrix show how many Avocado classified correctly as Avocado (True Positive), Avocado classified as Pineapple (False Negative), Pineapple classified correctly as Pineapple (True Positive), and Pineapple classified as Avocado (False Positive). See confusion matrix figure below. We will know which algorithm is better by see the value in confusion matrix.

confusion matrix

FOR EASY MEMORIZING
Avocado -> Positive
Pineapple -> Negative
So, if we input Avocado but the system FALSE guess it as Pineapple(NEGATIVE), it will be False Negative.
Let’s try once more
If we input Pineapple and the system TRUE guess it as Pineapple(NEGATIVE), it will be True Negative.

WARNING!!
NEVER MEMORIZING THE CONFUSION MATRIX TABLE!!!
Why? Because the position of input and output not always same. Sometimes the input is the row and the output is the column (like the picture above). But other time, the input is the column and the output is the row

HOW WE COMPUTE IT?
We can use confusion matrix to compute accuracy, sensitivity, and specificity.
Accuracy is the percentage the system predict Avocado and Pineapple correctly from all data.
Sensitivity is the percentage the system predict Avocado correctly from all Avocado.
Specificity is the percentage the system predict Pineapple correctly from all Pineapple.

equation

Thank you for reading πŸ˜€

REFERENCE
http://en.wikipedia.org/wiki/Confusion_matrix

Essam A. Rashed and Mohamed G. Awad, “Neural Networks Approach for Mammography Diagnosis using Wavelet Features,” First Canadian Student Conference on Biomedical Computing, 2006.

Advertisements