You have built a fraud detector. It is good. Tested on last year's transactions, it catches 95 per cent of the frauds and flags only 5 per cent of the honest payments by mistake. Your manager wants to know one thing: when it flags a transaction tomorrow, how likely is that transaction to be fraud?
Most people answer 95 per cent. Try it with numbers before you decide.
The napkin
Suppose your business processes 100,000 payments a day and, as in many card businesses, about one in a thousand is fraudulent. That is 100 frauds and 99,900 honest payments.
The model catches 95 per cent of the frauds: 95 flags, correct. It also flags 5 per cent of the honest payments by mistake: 5 per cent of 99,900 is 4,995 flags, wrong. Tomorrow morning the review team arrives to 5,090 flagged transactions, of which 95 are fraud. The chance that a flagged payment is fraud is 95 divided by 5,090, which is under 2 per cent.
Read that again, because it is the whole lesson. The model is exactly as good as advertised. Ninety-five out of a hundred flags are nonetheless wrong, not because the model failed but because fraud is rare and honest payments are many, and 5 per cent of many is more than 95 per cent of few. The accuracy that mattered was never the model's. It was the base rate's, and the base rate is a fact about the world, not about your code.
Now change one number. Make the false-alarm rate 0.5 per cent instead of 5. The wrong flags fall to about 500; the right ones stay at 95; a flag is now fraud about one time in six. Change it to 0.05 per cent and the flag is right two times in three. Nothing about the model's ability to find fraud changed in that exercise. Everything about its usefulness did. If you take one thing from this piece to your next project, take this: with rare events, the false-alarm rate is the number to fight for, and the detection rate is the number everyone will quote instead.
Why this keeps happening
The arithmetic is three hundred years old. Thomas Bayes's rule, published after his death in 1763, says how to update a belief when evidence arrives, and the update always depends on how likely the thing was before the evidence came. Doctors learn it and still get it wrong: in a well-known 1978 study at Harvard Medical School, staff and students were given a test with a 5 per cent false-positive rate for a disease affecting one person in a thousand, and most said a positive result meant a 95 per cent chance of disease. The correct answer was about 2 per cent. The same question, put to clinicians in later decades, has produced the same answers.
The error is not stupidity. It is that "95 per cent accurate" sounds like a property of the test, and people reason about properties. The base rate is not a property of the test. It is the background against which the test is read, and the background is easy not to see, especially when the model is impressive and the demo is clean.
Machine learning makes the trap deeper in a specific way. A model is trained and evaluated on a dataset, and datasets are usually built to be balanced, because a model trained on 999 honest payments for every fraud learns to say "honest" and stops. So the training set has, say, one fraud for every ten honest payments, and the evaluation numbers come out of that world. Then the model is deployed into the real one, where the ratio is one in a thousand, and the review team drowns. The model did not change. The base rate did, and nobody carried it across.
The bombers that came back
In 1943 the US Navy asked a group of statisticians in New York where to add armour to its aircraft. Planes returning from missions over Europe had bullet holes, and the holes were not spread evenly: many in the fuselage and wings, few in the engines. The obvious conclusion was to armour where the holes were. Abraham Wald, a Hungarian-born mathematician working with the Statistical Research Group at Columbia, saw the problem the other way round. The data came from planes that had returned. A plane hit in the engine was less likely to be in the sample at all. The holes showed where a bomber could be hit and survive; the armour belonged where the holes were not.
Wald's memoranda were classified and circulated for decades before they were published in 1980. The story has since become shorthand for survivorship bias, which it is, but it carries a second lesson that fits the fraud detector. Wald's first move was not to analyse the holes. It was to ask what population the holes were drawn from, and how that population differed from the one the Navy cared about. That is the base-rate question in another form: before you read the evidence, ask what world it came from.
Four questions before you trust a prediction
You do not need to be a statistician to protect yourself from the napkin problem. You need four questions, asked in order, of any model that will act on rare events, whether it predicts fraud, machine failure, disease, churn, or which of a thousand leads will buy.
How rare is the thing, in the world where the model will run? Not in the training set. If no one can say, the project is not ready to deploy.
What is the false-alarm rate, and what does each false alarm cost? A false alarm that costs a reviewer three minutes is tolerable at 5 per cent. One that cancels a customer's card is not.
What is the miss rate, and what does each miss cost? For some problems a miss is a few dollars; for others it is a crash or a death. The acceptable trade between misses and false alarms is a decision about costs, and it belongs to the people who bear them, not to the person who tuned the model.
Where did the evaluation data come from, and which planes did not come back? If the data was collected only from cases someone already suspected, the model has learned what suspicion looks like, not what fraud looks like.
Write the answers down with the model's accuracy, on the same page, in the same font size. When someone quotes "95 per cent" in a meeting, the page is what you hand them.
What good looks like
None of this argues against building the detector. A model that turns 100,000 payments into 5,090 to review has done most of the work; a model that turns them into 600 has done nearly all of it. The argument is about what you measure and what you promise. The teams that get this right report their models in the units the business pays in: flags per day, frauds caught per flag, cost of a miss. They set the threshold with the review team, not for it. And they check the base rate in production every month, because fraud changes when fraudsters learn what you catch, and a model whose world has moved is a bomber with armour in the wrong place.
The napkin takes two minutes. The alternative is a quarter spent explaining to a review team why the system that was 95 per cent accurate is wrong about nearly everything it shows them. Do the arithmetic first.
Sources
- Thomas Bayes, "An Essay towards Solving a Problem in the Doctrine of Chances", Philosophical Transactions of the Royal Society, 1763.
- Ward Casscells, Arno Schoenberger and Thomas Graboys, "Interpretation by Physicians of Clinical Laboratory Results", New England Journal of Medicine, 299 (1978): 999–1001.
- Gerd Gigerenzer, Reckoning with Risk: Learning to Live with Uncertainty, Penguin, 2002 (natural frequencies and the base-rate problem in medicine).
- Abraham Wald, "A Method of Estimating Plane Vulnerability Based on Damage of Survivors", Statistical Research Group memoranda, 1943; reprinted by the Center for Naval Analyses, Research Contribution 432, 1980.
- Marc Mangel and Francisco Samaniego, "Abraham Wald's Work on Aircraft Survivability", Journal of the American Statistical Association, 79 (1984): 259–267.
- Illustrative figures in the worked example (100,000 payments, one fraud in a thousand, 95 per cent detection, 5 per cent false alarms) are hypothetical, chosen for arithmetic clarity; typical card-fraud rates are of the order of one in a thousand by count, per industry reporting, and the editor may wish to cite a current source such as the Nilson Report.
This article does not necessarily reflect the views of Flames of Olympus.
Ideas deserve to travel.If this made you think differently, share it with someone who loves a good question.
Tell us the passage and, if you can, a source. A responsible editor will review the evidence.
Report an errorCorrections policy →



