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 , 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 , where FN (false negatives) are missed positives.
Steps
- 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.
- Read off the counts for the spam filter: flagged 10, of which 8 are spam, so and . Spam in the inbox is 16, so the filter missed .
- Precision . Four in five flags were right.
- Recall . Half the spam was caught.
- 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
- Mixing up the denominators. Precision divides by what you flagged; recall divides by what is truly positive.
- Using accuracy alone on rare events. A filter that flags nothing can still be 'accurate' when spam is rare.
- Quoting one number without the other. A high precision with a low recall hides how much is being missed.
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?