Confusing with Confusion Matrix

Charan Vaddepally
2 min readJun 6, 2021

What is a confusion matrix?

A confusion matrix is a matrix representation of the summary of predicted values and the actual values. It helps us recognise the accuracy of our predictions by taking into consideration we are dealing with the classification predictions. The summary is extremely necessary to determine the performance of the model after it is trained with some training data.

This is the actual look of a confusion matrix( for binary classification) . It contains 4 parts in it(for binary).

All the four parts of it are helpful in checking the accuracy score of our predictions.

Let’s Understand what are TP, TN, FP and FN

For clear understanding let us take an example of happening of a cyber attack on our servers.

In the above case, There are two possibilities, either Attack is going to happen or it is not going to happen.

1: True Positive: Let’s say, Our prediction was that the attack won’t happen, so it is a positive, and the reality is the attack didn’t happen. So our prediction was true and it was in our favour. So we count it as a True Positive

2: True Negative: Let’s say, Our prediction was that the attack will happen, so it is a negative, and the reality is the attack has happened. So our prediction was true even though not in favour, but the prediction was True, so we count it as a True Negative.

3: False Positive: Let’s say, Our prediction was that the attack won’t happen, so it is a positive, but the reality is the attack has happened and our prediction was wrong. So we count it as False Positive.

Note: False Positive is the most dangerous one and is known as Type-I error

4: False Negative: Let’s say, Our prediction was that the attack will happen, so it is a negative, but the reality is the attack didn’t happen and our prediction was wrong. So we count it as False Negative.

Note: It is known as Type-II error

--

--