Why Accuracy Lies
In a Plateful review meeting, the fraud team reports that the new payment-fraud detector — the one that learned the shape of normal back in Chapter 5 — is 99% accurate. Iris expects applause. Instead, the head of data asks one quiet question: "And what does a model that flags nothing score?" The answer, it turns out, is also 99%. Roughly one transaction in a hundred is fraud, so a cardboard sign reading "all transactions are fine" is right ninety-nine times out of a hundred while catching zero fraud.
This page is about that trap — the most useful debunking in the book. Accuracy is the share of predictions that were right, and it is the metric everyone quotes first: dashboards lead with it, vendors advertise it, headlines round it up. It is not a villain. But it has one specific blind spot, and the blind spot sits exactly where the stakes are highest. By the end of this page you will spot it in one question.
Accuracy, Defined and Defended
First, the honest definition. Take every prediction the model made on the test set — the held-out examples from Topic 13 — and count the share it got right. A thousand predictions, 990 correct: 99% accuracy. One number, easy to compute, easy to compare, easy to say in a meeting. There is a reason it is everyone's first metric.
And in the right conditions it is a perfectly good one. When the classes are roughly balanced — about as many genuine reviews as fake ones in the test data — and when both kinds of mistake cost about the same, accuracy tells you what you think it tells you. A photo model sorting pizza from pasta can live on accuracy alone. The point of this page is not "accuracy is bad". It is: accuracy has a blind spot, and you need to know exactly where it is.
The Rare-Class Trap
The blind spot is rarity. Fraud is about 1% of Plateful's transactions, which means "fine" outnumbers "fraud" ninety-nine to one. Machine learning has a name for this: class imbalance — one category vastly outnumbering the other in the data. Under heavy imbalance, the strategy "always say the common thing" scores in the high nineties without learning anything at all. The cardboard sign is 99% accurate because the world is 99% fine, not because the sign knows anything about fraud.
Here is the same trap in household form. Judge a smoke detector by the share of minutes it gives a correct reading, and a detector that sleeps through the one fire still scores 99.99% — almost every minute of its life, "no fire" was the right call. The score was averaged over millions of boring minutes; the job was the fire. That is precisely what accuracy does to the fraud model: it averages over the 990 easy transactions and lets them drown out the 10 that were the entire point.
Two Questions That Keep You Honest
The first question you already half-own. Topic 15 said every score needs a floor — the dumbest strategy available. Now the floor has teeth: before reacting to any accuracy claim, ask "compared to what? What does always-guessing-the-majority score here?" If the answer is 99% and the model scores 99%, the model has contributed nothing, however impressive the number sounds on its own. On balanced data the floor sits near 50% and a 93% model is doing real work; on Plateful's fraud data the floor is the headline number.
The second question digs where the average can't reach: "what's the score on the rare class alone?" Of the ten actual frauds, how many did the model catch? The cardboard sign answers zero out of ten; the real detector answers eight out of ten — and suddenly the two identical 99%s pull apart. That one question is the door to the next two pages: precision and recall are, roughly, this question asked carefully from both directions.
Imbalance Is the Normal Case
It would be comforting if the rare-class trap were an edge case. It is the opposite: in business ML, the class you care about is usually the rare one. Fraud is rare among transactions. Disease is rare among screenings. Defects are rare on the production line. Fake reviews are a sliver of all reviews, and the customers who will churn this month are a small minority of everyone active today. The interesting class is almost always the needle, not the haystack.
Which means the flattering-accuracy problem is not a curiosity — it is the default condition of the problems worth solving. Honest measurement starts by admitting that, and the rest of this chapter is the toolkit built for it: two sharper metrics on the next page, the four-cell table they come from after that, and on the chapter's last page, the discipline that catches this trap — and several others — before the applause.
- "99% accurate means an excellent model." Check the class balance first. If 99% of the data is one class, a do-nothing strategy scores exactly the same 99% — the number may be measuring the imbalance, not the model.
- "So accuracy is a bad metric." No — it is honest on balanced problems where both error kinds cost about the same. It lies specifically on rare-class problems. Knowing which situation you are in is the actual skill.
- "If accuracy is high, the rare class must be handled." A model can be 99% accurate while catching 0% of the rare class. The average is dominated by the easy majority; it says nothing about the needles.
- "Class imbalance is an exotic special case." Fraud, disease, defects, fake reviews, churn — the interesting class is usually the rare one. Imbalance is the normal condition of high-stakes ML, not the exception.
- Vendors, papers, and dashboards lead with accuracy. You can now audit any such claim with one question — "what does always-guessing-the-majority score?" — asked in plain English, no math required.
- "What's the score on the rare class alone?" is the question that separates a real detector from a cardboard sign. The next two pages turn it into proper instruments.
Knowledge Check
A dataset of 1,000 transactions contains 990 fine and 10 fraudulent. What does the strategy "always say fine" score, and how many frauds does it catch?
- About 50% accuracy, catching 5 of the 10 frauds by chance
- 99% accuracy, catching none of the frauds
- 0% accuracy, because it never identifies fraud
- Accuracy can't be computed for a strategy that never flags anything
In which situation is accuracy a trustworthy metric on its own?
- Screening for a disease that affects 1 person in 200
- Sorting photos into pizza vs pasta, both dishes equally common and mistakes harmless
- Flagging fraudulent payments, where fraud is about 1% of transactions and the rest are ordinary
- Predicting which few customers will churn this month
A vendor demos a defect detector: "99.5% accurate on real production data." What is the single best follow-up question?
- How long did the model take to train?
- How many parameters does the model have?
- Was it trained on a large enough dataset with plenty of production examples?
- What would "never flag anything" score on that same data?
The real fraud detector and the cardboard sign both score 99% on the same 1,000 transactions. What actually separates them?
- Rare-class performance — 8 of 10 frauds caught versus none
- Their accuracy, once you compute it to more decimal places
- The detector answers faster than the sign
- The detector attaches confidence scores to its predictions
You got correct