Precision and Recall Evaluation Metrics in Machine Learning

Precision and Recall are two best known and most misunderstood evaluation metrics in machine learning. In this article we are going to discuss the simplest way in which we can understand them with an example.

Consider that we were playing a simple game online. The rules of the game are pretty simple, you will have to shoot the space ships of the opposition constantly, until you see a survivor space ship coming toward you.

Space game example for understanding precision and recall

Now let’s consider that your model was playing the game from a long time and have collected a lot of related data.

Data points that we collected belonged to these 3 categories.

Total time you Stopped shooting: x
Total time you Stopped shooting with survivor ship ahead you: y
Total time you Stopped shooting with Opposition Space ship ahead you: z

Now, we created a Venn diagram to explain the occurrences.

Venn diagram for understanding precision and recall

Precision

Precision is the value which gives the value of number of times you took the correct action of all the times you took an action.

So, precision is given by the intersection divided by the blue part of the Venn diagram. i.e.

$precision = \frac{Correctly\ stopped\ shooting}{Total\ Number\ of\ Shooting\ stops}$

Recall

Recall is the value which gives the value of all the times you were supposed to take an action of all the times you took an action.

So, Recall is given by the intersection divided by the orange part of the Venn diagram.

$recall = \frac{Correctly\ stopped\ shooting}{Total\ Number\ of\ times\ survivor\ ships\ in\ front}$

More detailed discussion of precision and recall are done in the evaluation metric post.


We don't share your details with others