Confusion Matrix : Must For Data Scientist and Machine Learning Engineer

How To Use Confusion Matrix To Desire

Laxman Singh
Analytics Vidhya

--

Confusion matrix is one of the tables generated to visualise performance of algorithm or model. Learning confusion matrix is must to understand the performance of your model to test or validation data. It is also known as error matrix.

Actual values and predicted values are displayed in a tabular format using confusion matrix. It will be very complex to evaluate the values if there are more than two classes to predict. So, I will restrict this to two classes to make it understand better. I will also not going to play with data and values in this.

Terms to be learn before going into deeper in confusion matrix.

True Positive: When actual class is 1 and model is also predicting it as 1. This will be treated as true positive.

False Positive: When actual class is 0 and model is predicting is as 1. This will be treated as false positive.

True Negative: When actual class is 0 and model is predicting it as 0. This will be treated as true negative.

False Negative: When actual class is 1 and model is predicting it as 0. This will be treated as false negative.

In all the above explanation, 1 could be treated as True class and 0 as negative class. For example: While predicting the rain will happen or not, 1 is true class and 0 is negative class.

--

--

Laxman Singh
Analytics Vidhya

Machine Learning Engineer | Data Science | MTECH NUS, Singapore