Precision, Recall and the Confusion Matrix
In this article
- Sort eval cases into the four cells of a confusion matrix and read accuracy, precision and recall from its rows and columns.
- Explain why an assistant that never says yes can score high accuracy when the yes cases are rare.
- Choose the rate a release check should read from which kind of mistake costs more.
- Report F1, per-class rates and field-level scores without hiding the error, class or field that fails.
- Terms defined here: confusion matrix, accuracy, precision, recall, true negative rate, F1, macro average.
Overview
An eval, a repeatable test over saved cases, reports that a support assistant decided correctly whether to hand a conversation to a person in 93% of cases. That sounds like a pass, until you ask what an assistant that never hands anything over would score.
In an invented example, Brightline, a home-internet provider, runs a support assistant on its website that answers customers and can look up an order, issue a refund of at most $50 and hand a conversation to a person on the support team. Its team is testing a switch from model version orbit-flash-2 to orbit-flash-3 on a 200-case release set, saved cases kept back for the release decision; both model names are invented. Sorting its cases into four outcomes shows which number a release check should read.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Four outcomes for one yes/no label
- Accuracy and the rare class
- Precision and recall
- F1 and the whole report
- Several labels and extracted records
- Choosing the rate to gate on
- Common mistakes
- In production
- Sources
- Check yourself, 5 questions