Precision and Recall

Imagine there is a class of 18 students, in which 8 students are genius in reality. And 10 students are not genius. Say, we develop a model to classify the students into two labels — “Genius” and “Not Genius”. Now, we would like to evaluate this model. To evaluate any such binary classifiers we use a metrics known as — Precision and Recall.

Recall is the measure of how correctly the model can recall the real events that actually happened in the past while data was being collected. In our case, the left most diagram below shows a representation of the class. Red crosses are genius students. White crosses are not genius guys. Green ringed crosses are the guys who were predicted as genius by our model. The crosses without green ring were predicted not genius.

To be able to measure the “Recall”, we will be focusing on only the red crosses — the real genius. That is represented in the second diagram. Of all the 8 real genius students, only three were positively predicted by our model. So the measure of recalling correctly for Geniuses in our model is 3/8.

To be able to measure the “Precision”, we will be focusing only on the crosses which are green ringed. That is represented in last diagram below. Of all the prediction, we see that only 3 were correct. The remaining 3 are wrong. So, the precision is 3/6.