In plain words, what are precision and recall for a binary classifier? A spam filter flags 10 emails and 8 of them are truly spam, while the inbox holds 16 spam emails in all. What are its precision and recall?

ML systems and evaluation, Classification metrics
Level L1 Beginner. Length Short. Nature Th+Mat Both.

What's being asked

Whether you can state the two metrics as answers to two different everyday questions before using them in F-scores or curves.

Key idea

Precision answers: of the things I flagged, how many were really positive? It equals TPTP+FP, where TP (true positives) are correct flags and FP (false positives) are wrong flags. Recall answers: of all the real positives, how many did I catch? It equals TPTP+FN, where FN (false negatives) are missed positives.

Steps

  1. Use a fishing net picture. Precision asks how much of what is in the net is fish. Recall asks how many of the fish in the lake ended up in the net.
  2. Read off the counts for the spam filter: flagged 10, of which 8 are spam, so TP=8 and FP=2. Spam in the inbox is 16, so the filter missed FN=16−8=8.
  3. Precision =TPTP+FP=88+2=810=0.8. Four in five flags were right.
  4. Recall =TPTP+FN=88+8=816=0.5. Half the spam was caught.
  5. Say why both are needed: a filter that flags almost nothing can have high precision and poor recall, while one that flags everything has perfect recall and poor precision. Raising the decision threshold usually trades recall for precision.

Common mistakes

How long your answer should be

About 2 minutes: the net picture, then 0.8 and 0.5.

Read this

Previous in ML systems and evaluation: none
Next in ML systems and evaluation: What is a confusion matrix for a binary classifier, and what do its four cells mean? A spam filter checks 100 emails, 20 of which are spam. It flags 18 emails as spam, and 15 of those really are spam. What goes in each cell?