Precision and Recall
Metric
A pair read together: the share of what the model flagged that was actually right, and the share of what was actually right that the model found.
Why it exists
Read the accuracy figure alone and a model doing nothing scores well. If 2 percent of accounts are spam, a model answering "not spam" to everything is 98 percent accurate. The report says 98 and the spam caught is zero. Nothing about the figure is false, which is what makes it dangerous.
This happens whenever the data leans one way, and the thing you're looking for being rare is usually the reason the model was built at all.
The second problem is that the two kinds of error cost different amounts. Block a legitimate account as spam and that team can't log in, files a ticket, and usually leaves. Miss a spam account and you can delete it a few days later. The damage from the two directions differs by something like tenfold, and a single accuracy figure contains none of that difference. Both are errors; only one of them loses a customer.
So a pair that splits error into two directions took hold. One side measures what was wrongly caught; the other measures what was missed. Neither number is meaningful without the other beside it.
How to calculate it
Start by sorting the outcomes into four boxes — whether something was actually spam, against whether the model said it was.
- Spam, called spam. Correctly caught.
- Not spam, called spam. Wrongly caught.
- Spam, called not spam. Missed.
- Not spam, called not spam. This box is the one that inflates accuracy, and neither figure below uses it.
Precision is the share of everything the model called spam that was correctly caught: box 1 over boxes 1 and 2. Of 200 items flagged, 150 actually spam gives 75 percent.
Recall is the share of all actual spam that got found: box 1 over boxes 1 and 3. If there were 500 actual spam accounts, 150 over 500 is 30 percent. The same model reading 75 on one figure and 30 on the other is exactly why the pair gets read together.
The two move in opposite directions when you shift the decision threshold. A model typically outputs a probability, and a person decides what level counts as spam. Raise the threshold from 0.5 to 0.9 and only the certain cases get caught, so wrong catches fall and precision rises while borderline cases get missed and recall falls. Which means raising both isn't a threshold adjustment; it's changing the inputs or adding data. The threshold decides how to spend a fixed amount of model quality.
When one number is required, use the harmonic mean of the two. A plain average is avoided because it hides one side being near zero: precision of 100 with recall of 2 averages to 51 arithmetically and to 4 harmonically. The second number is the one that describes the model honestly.
The measuring conditions are fixed too. Labeled data is required, so this belongs to supervised learning, and the measurement runs on data not used in training. Measure on training data and an overfitted model reports both figures high. A number measured there describes memory rather than ability.
What a good number looks like
There's no absolute threshold. Where to set each one follows from what each direction of error actually costs.
Where missing is expensive, recall leads. Disease screening and security detection work that way: the cost of a wrong catch is one more human check, and the cost of one missed case is large. Asymmetry that extreme makes the choice obvious.
Where wrong catches are expensive, precision leads. Blocking a legitimate account, or issuing an automatic refund, sits here. Pagedeck's spam judgment is on this side, so precision was required at 95 percent or above while recall started at 60. Missed spam comes back as a report; a wrongly blocked team just leaves.
Where both are expensive, you split into bands. Anything above 0.95 gets handled automatically, 0.6 to 0.95 goes into a queue a person reviews, and below that passes through. Precision stays high in the automatic band while recall is preserved overall, which is usually the only way to get both. The constraint is whether the queue is a volume people can absorb — at 300 items a day it doesn't hold.
Setting the threshold starts from cost rather than from a number. Convert one wrong catch and one miss into money or time, then set the decision threshold to that ratio. Converting to money is what stops the discussion from being about preferences. The comparison isn't an industry figure but your previous model and human judgment. If the manual review people were doing ran at 88 percent precision, that's the first target, and the threshold gets written down alongside it.
How it sounds at work
"Ninety-eight percent accuracy means nothing here. Spam is 2 percent."
Accuracy is useless on leaning data.
"Let's take precision to 95 and start recall at 60."
Splitting the targets from the cost of each error direction.
"Raising the threshold drops recall with it. We need to work on the features."
A threshold adjustment can't raise both.
Pagedeck's spam account judgment went this way. The first report said 97 percent accuracy; splitting it out, Theo found 62 percent precision and 41 percent recall. Four of every ten accounts flagged as spam were legitimate.
Raising the threshold took precision to 94 percent and dropped recall to 26. Grace decided to turn on automatic blocking in that state, because missed spam arrives as a report while a wrongly blocked account doesn't come back. The remaining band went to Sofia, who reviews it as a list each morning. Twenty minutes a day bought back most of the recall.
What people get wrong
The most common belief is that high accuracy means a good model. It summarizes into one number, which makes it easy to report and intuitive to read. Reporting one number is easy; choosing which number is the actual work. But on a problem where the target is rare, that number reflects the data's lean more than the model's ability. On a task of finding 2 percent of the population, 98 is the starting line rather than an achievement. Judge by it and you ship a model catching nothing, then ask two months later why the spam is still there.
The other frequent belief is that both figures can simply be raised. Writing 90 next to each in the goals looks reasonable. But as long as only the threshold moves on one model, the two go opposite ways. Raising both means changing the values used as input — the features — or adding training data, and unlike a threshold change, that takes weeks. When goals list two figures, they should also state which one gets protected first.
Where to go next
- Machine learning
see how method, task, input, and evaluation connect
- Supervised learning
see the approach that creates the conditions for measuring these two
Last updated 2026-09-16