Accuracy lies when the rare case is the one that matters
Precision, recall, and why 99% can be a useless model
If one case in a hundred is the one you care about, a model that never finds it is 99% accurate. Precision and recall say what accuracy hides.
Suppose one transaction in a hundred is fraudulent. A model that answers "not fraud" every time is right 99 times out of 100. Its accuracy is 99%, and it has never caught anything.
The four outcomes
Every prediction on a yes/no question lands in one of four boxes: a true positive (said yes, was yes), a false positive (said yes, was no), a false negative (said no, was yes) and a true negative. Accuracy counts the two correct boxes and ignores which kind of mistake you made.
Two questions instead of one
The two pull against each other. Flag more things and recall rises while precision falls.
Choosing where to stand
Most models output a score and you pick a threshold. Where it should sit depends on the cost of each mistake. A screening test for a serious illness accepts false alarms to avoid misses. A spam filter that hides real mail accepts a few spam messages to avoid losing something important. There is no universal best threshold, only one that fits the cost.
One number when you need one
The F1 score combines precision and recall, and punishes a model that is good at only one. It is a summary, not a decision. Look at the two numbers underneath it.