Analytics Vidhya
Published in

Analytics Vidhya

Let's make the “Confusion matrix” less confusing!!

“Doubts are good. Confusion is excellent. Questions are awesome.
All these are attempts to expand the wisdom of mind.”
Manoj Arora

The confusion matrix shows the ways in which your classification model is confused when it makes predictions.

Confusion Metrix

What is the Need of a Confusion Matrix?

Precision vs. Recall

Precision tells us what proportion of patients we diagnosed as having the virus actually had the virus.

Recall tells us what proportion of patients that actually had virus were predicted by us as having virus.It should be high as possible.

Note: Recall tells you how much of the +ve’s you can find.

Precision tells you how much junk there is in your predicted +ve’s.

F1 score

It’s a measure of a test’s accuracy. It considers both the precision and the recall of the test to compute the score using the harmonic mean.

More formulas

Confusion Matrix using scikit-learn in Python

Evaluating the Algorithm

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store