Reading a Confusion Matrix: A Manager's Guide to Judging AI Models
Why 96% accuracy can mean almost nothing and how to set an AI model’s threshold by the cost of each kind of error
Key takeaways
A confusion matrix splits a model's results into four cells. The two kinds of error, false positives and false negatives, usually cost very different amounts, so merging them into one "error rate" throws away the most useful information.
When the class you are hunting for is rare, overall accuracy is dominated by the common class: a "model" that flags nothing can score higher than a useful one.
Precision, recall (sensitivity) and specificity each answer a different business question. Sensitivity and specificity do not depend on the base rate; precision does, and it falls sharply as the target class gets rarer.
The threshold is a business decision. In the worked example the cheapest threshold has one of the lowest accuracy scores, because a missed fraud costs 60 times as much as a manual review.
Splitting the matrix by customer group can show a model that is fair by one definition and unfair by another; sometimes the best fix lies in how the business acts on a flag, not in the model.
Imagine a data team presenting to the board: "Our fraud detection model is 96.2% accurate." Heads nod around the table. But is that number good or bad? Nobody can say without two more facts: how rare fraud is and how much each kind of model error costs. A model that does nothing at all, simply declaring that no order is fraudulent, can score higher still.
This scene plays out in companies everywhere, from banks screening card payments to insurers screening claims and retailers screening online orders. Managers do not need to know how to train a model, but they do need to know how to read the numbers used to evaluate one, because those numbers drive the decision to buy, deploy or stop an AI system. The tool for reading them is the confusion matrix, a simple table of two rows and two columns that holds almost everything a decision maker needs.
The article has five sections. Section 1 introduces the confusion matrix through a concrete example. Section 2 explains the accuracy paradox. Section 3 presents the alternatives: precision and recall, plus the pair of sensitivity and specificity familiar from medicine. Section 4 shows that choosing a model's threshold is a business decision that can be priced in dollars. Section 5 splits the matrix by customer group to check fairness, then closes with the questions to ask when a vendor pitches a model.
1. The confusion matrix
This section builds the four-cell table that the rest of the article relies on, using one running example.
The example is Harbor Home, a hypothetical furniture retailer with an online store. In one month it receives 10,000 online orders, 200 of which are fraudulent (2%). Its model flags 500 orders as suspicious so that staff can check them, and 160 of those 500 turn out to be real fraud. Every outcome of a two-class classification model falls into one of four cells, as in Figure 1.
Each of the four cells in Figure 1 has a name. A true positive (TP) is a fraudulent order that was flagged: 160 orders. A false positive (FP) is a legitimate order that was flagged: 500 − 160 = 340 orders. A false negative (FN) is a fraudulent order that was not flagged: 200 − 160 = 40 orders. A true negative (TN) is a legitimate order that was not flagged: 9,800 − 340 = 9,460 orders. The single most important point is that the two kinds of error, false alarms and misses, usually carry very different costs. Lumping them together into one number called "errors" discards the information that matters most.
2. The accuracy paradox
This section shows why the most quoted number in model reports can be the least informative.
Accuracy is the share of all cases the model gets right: (160 + 9,460) / 10,000 = 96.2%. That is exactly the number presented in the boardroom at the start of this article.
Now consider a lazy "model" that never flags anything. It is right about all 9,800 legitimate orders and wrong about all 200 fraudulent ones, so its accuracy is 9,800 / 10,000 = 98%, higher than the real model. This is the accuracy paradox: when one class is very rare, overall accuracy is dominated by the common class and becomes almost meaningless. Fraud, customer churn, machine breakdowns and rare diseases, the very problems businesses care about most, are typically problems with a rare class. Whenever the base rate is ignored, a reassuring percentage can hide a model that adds little or nothing.
3. Precision, recall, sensitivity and specificity
The measures in this section fix the paradox by looking at individual rows or columns of the confusion matrix instead of pooling all four cells. They answer different questions that matter to different people in the business.
3.1. Two formulas, two denominators
Precision and recall are calculated as follows:
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
Precision answers the question "of the orders we flagged, what share are really fraud?" In the example it is 160 / 500 = 32%. Recall answers "of the orders that really were fraud, what share did the model catch?" In the example it is 160 / 200 = 80%. The denominator is the crucial difference: precision divides by the number of orders the model flagged, recall divides by the number of orders that were actually fraudulent. The review team feels precision, in the form of how often they have to phone a perfectly honest customer. The chief financial officer feels recall, in the form of how much money is still being lost.
3.2. Sensitivity and specificity
Medicine and statistics usually describe a test with a different pair of measures. Sensitivity is the share of actual positives that are detected; it is recall under another name, also called the true positive rate. Specificity is the share of actual negatives correctly identified as negative:
Sensitivity = TP / (TP + FN)
Specificity = TN / (TN + FP)
In the example, sensitivity is 160 / 200 = 80% and specificity is 9,460 / 9,800 ≈ 96.5%: of the 9,800 legitimate orders, the model leaves 9,460 alone. The complement of specificity is the false positive rate, 340 / 9,800 ≈ 3.5%, the probability that an honest customer is wrongly flagged.
This pair has an important property: both measures divide by the actual number of cases in each class (the columns of the matrix), so neither depends on the base rate. A model with 80% sensitivity and 96.5% specificity keeps those two numbers whether fraud makes up 2% or 10% of orders. Precision is different: it divides by the number of flagged orders (a row of the matrix), so it drops sharply as the target class becomes rarer. That is why a medical test with high sensitivity and high specificity can still produce a flood of false positives when the disease is rare, and it is why precision is only 32% in the example even though specificity reaches 96.5%.
Plotting sensitivity against the false positive rate (1 minus specificity) across every possible threshold gives the ROC curve (receiver operating characteristic), a common way to compare models without first committing to a threshold. The closer the area under the curve (AUC) is to 1, the better the model separates the two classes (Fawcett, 2006). Section 4 shows why a business still has to pick one specific threshold in the end.
3.3. Matching the measure to the business question
No single measure is best in every situation. Table 1 summarizes the four measures and the situations in which each matters most.
Table 1 shows that choosing the wrong measure means optimizing for a question the business is not asking. A spam filter should favor precision, because sending an important email to the spam folder costs more than letting one advertisement through. A product safety screening system should favor recall, because missing one defect could cause an accident. A model can be right most of the time and still be wrong in exactly the places that matter.
4. The threshold is a business decision
This section turns the matrix into money and shows that the "right" threshold is the one with the lowest total cost.
A model does not say "fraud" or "not fraud" directly. It gives each order a probability, and a threshold decides how high that probability must be before an order is flagged. Lowering the threshold flags more orders: recall rises and precision falls. Raising it does the opposite. There is no technically "correct" threshold; the right one is the threshold with the lowest total cost.
4.1. Costing each threshold
At Harbor Home, each fraudulent order that slips through costs an average of $120 (the cost of the goods plus delivery), while a manual review of a flagged order costs $2. At the 0.5 threshold used so far, total cost is 40 × $120 + 500 × $2 = $5,800, compared with $24,000 without any model (all 200 frauds get through). Table 2 repeats the calculation for five thresholds.
The sensitivity and specificity columns in Table 2 show the core trade-off: lowering the threshold from 0.9 to 0.1 lifts sensitivity from 25% to 98% but pushes specificity down from 99.9% to 71.4%. Figure 2 puts the last two columns of Table 2 on one chart to show that the most accurate threshold and the cheapest threshold are not the same.
4.2. The best threshold is not the most accurate one
Figure 2 runs against intuition in two ways. First, the 0.7 threshold has the highest overall accuracy (98.6%) but costs $9,960, about 1.7 times as much as the 0.5 threshold. Second, the cheapest threshold is 0.3, with overall accuracy of only 89.7% and precision of about 15%, meaning that roughly six of every seven reviewed orders come from good customers. This choice makes sense only because a missed fraud costs 60 times as much as a review. If reviews became more expensive, for example because each one means a phone call that irritates the customer and may lose the sale, the optimal threshold would move up.
This is a concrete case of the distinction between prediction and judgment proposed by Agrawal, Gans and Goldfarb: machines supply predictions, while people supply judgment about the consequences of each choice (Agrawal et al., 2022). The model supplies a probability; choosing the threshold is judgment, because it depends on the cost of each kind of error, which only the business knows. Leaving the threshold to the technical team, who often default to 0.5 or maximize overall accuracy, hands a business decision to people who lack the information needed to make it. The same arithmetic, scaled up to the full investment, becomes the core of a business case for any AI project.
5. Splitting the matrix by group to check fairness
A single overall confusion matrix can hide large differences between customer groups. This section splits Harbor Home's matrix into two groups, then distills the lessons into questions to ask of any classification model.
5.1. One model, two customer groups
Over one quarter, the model reviews 8,000 orders from large metropolitan areas and 2,000 orders from rural regions. A flagged order is held for verification, which makes a genuine customer wait several extra days. The true fraud rate differs between the groups: 2% in the metro areas (160 orders) and 6% in the rural regions (120 orders), for instance because long-distance deliveries are harder to verify. The model catches 128 of the metro frauds by flagging 280 orders and 96 of the rural frauds by flagging 210 orders. Table 3 breaks the measures down by group.
Table 3 shows that the model catches fraud equally well (same sensitivity) and flags equally accurately (same precision) in both groups, but specificity is lower in the rural group, so an honest rural customer is about three times as likely as an honest metro customer to have an order wrongly held. Whether the model is "fair" depends on which definition of fairness is chosen.
Could the model be fixed to meet all of these definitions at once? The answer, proved independently by two research teams in 2016 and 2017, is no, except in very special cases. Chouldechova showed that when base rates differ between groups, common fairness criteria cannot all be satisfied at the same time (Chouldechova, 2017). Kleinberg, Mullainathan and Raghavan proved a similar result for risk scores: no method can meet three fairness conditions simultaneously unless prediction is perfect or base rates are equal (Kleinberg et al., 2016). Fairness is therefore a reasoned choice, not a calculation. In this example, one effective way to reduce harm is to change the action from "hold the order for three days" to "call to verify within two hours": the damage to honest customers falls sharply without letting a single extra fraud through.
5.2. Five questions to ask when a vendor pitches a model
Two vendors pitch two models, one claiming "98% accuracy", the other "90% recall". Buyers are tempted to pick the bigger number. The mechanism behind this mistake is that the two numbers measure different things, possibly on different data sets, yet both are presented as a "quality score", so we compare them on the same scale. The five questions below help avoid the trap:
What does the full confusion matrix look like on a test set drawn from our own business?
Does the base rate of the rare class in the test set match reality?
Which threshold does the model use, and how does total cost change when the threshold changes?
Do the measures differ across our important customer groups?
When were the results measured, and how will the model be monitored as the data change?
The fifth question is a reminder that a confusion matrix is true only at the moment it was measured. When fraud behavior shifts, the numbers shift too, which is why measures such as the false positive rate by group belong in an AI risk register and should be reviewed on a regular schedule.
Conclusion
A high accuracy figure says little until you know how rare the target class is and how much each kind of error costs. The confusion matrix splits a model's results into four cells, in which the two errors, false alarms and misses, usually carry very different costs. Precision, recall (also called sensitivity) and specificity measure different sides of those two errors; sensitivity and specificity do not depend on the base rate while precision does, and each serves a different business question.
The most practical lesson is that a model's threshold is a business decision. With a miss costing 60 times as much as a review, the cheapest threshold in the example has one of the lowest overall accuracy scores. Splitting the matrix by customer group further shows that the same model can be fair by one definition and unfair by another, and that the best way to reduce harm sometimes lies not in the model but in how the business acts on its output. Managers do not need to build models themselves, but they should insist on seeing the confusion matrix and multiply it by their own cost table.
References
Agrawal, A., Gans, J., & Goldfarb, A. (2022). Prediction machines: The simple economics of artificial intelligence (Updated and expanded ed.). Harvard Business Review Press. https://store.hbr.org/product/prediction-machines-updated-and-expanded-the-simple-economics-of-artificial-intelligence/10598
Chouldechova, A. (2017). Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. Big Data, 5(2), 153–163. https://doi.org/10.1089/big.2016.0047
Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861–874. https://doi.org/10.1016/j.patrec.2005.10.010
Kleinberg, J., Mullainathan, S., & Raghavan, M. (2016). Inherent trade-offs in the fair determination of risk scores (arXiv:1609.05807). arXiv. https://arxiv.org/abs/1609.05807




Discussion about this post