BitBootcampBitBootcamp ← all explainers 🔄 Review ⚙ Settings

Drill 96 — The Wrong Number

Theme: Evaluation & Validation · Format: 20-min drill · Difficulty: core

The story

A card issuer's data-science team spends a quarter rebuilding the real-time fraud model that scores every transaction before it authorizes. At the model review, the headline slide is clean and confident: 97% accuracy on a held-out month of a million transactions. The room exhales. The old rules engine was a tangle nobody trusted; here is a model that gets the answer right ninety-seven times out of a hundred. It passes review, replaces the incumbent on the authorization path, and the team moves on to the next roadmap item.

Nobody in the room asks the one question that matters: how often is a transaction actually fraud? The answer, sitting in the same warehouse, is about 3% — thirty thousand fraudulent transactions in that million-row month. On a base rate like that, a model that simply stamps "never fraud" on every transaction is also right 97% of the time. The headline number the whole room celebrated is the number you get for doing nothing.

Three months later, the fraud-operations team raises a flag that has nothing to do with a dashboard. Chargeback losses are flat — not falling, the way everyone assumed they would after shipping a shiny new model. The model runs green, throws no errors, and reports the same 97% accuracy it reported at review. It is doing exactly what the metric said it would. The metric just never measured the thing the model exists to do.

⏸ Stop here and ask the room: the model is genuinely 97% accurate on a fair, held-out month. On a problem where fraud is 3% of traffic, why does that number tell you almost nothing about whether the model catches fraud?

Run it — facilitator script

Timing for a 20-minute session: 2 min story · 10 min staged questions · 3 min reveal · 5 min transfer.

97% accuracy on a 3% fraud rate — what is that number actually measuring?

If not accuracy, what should the review slide have shown?

The scores drive an approve/decline threshold — what else has to be true?

The reveal

Pull the confusion matrix at the live threshold and the 97% evaporates. Of the 30,000 frauds that month, the model catches about 2,400 — a recall of 8%. It is precise (of the 3,000 transactions it flags, ~2,400 are real, 80% precision), so it looks disciplined, but 27,600 frauds sail straight through. Accuracy is 97.2%; the never-fraud baseline is 97.0%. The entire quarter of work bought two-tenths of a percentage point of accuracy — and, in dollars, cut monthly fraud losses from roughly $6.6M to $6.1M when a model actually targeting recall could have taken them to ~$2.4M. The team rebuilt the evaluation around expected loss and recall at the operating point, put the confusion matrix and the naive baseline on every review slide, and added a calibration gate. The next model shipped because it caught 70% of fraud, not because it was 97% accurate.

Why this happens — the mechanics

Accuracy is (TP + TN) / total — a count-weighted average over the whole population. When one class is 97% of the traffic, that class's true negatives dominate the sum, and the model's behavior on the rare, expensive class barely moves the number. This is the accuracy paradox: on an imbalanced problem, the trivial majority-class predictor is a strong accuracy baseline, so any accuracy figure has to be read relative to the base rate, never in absolute terms. 97% is meaningless until you know that 97% is also the score for doing nothing.

The costs make it worse. Accuracy treats a missed fraud and a wrongly declined customer as identically weighted single errors, when a missed fraud is a full chargeback plus fees and a false decline is a few dollars of friction. The metric that matches the decision is expected loss, computed from the confusion matrix at the actual threshold with real per-cell costs — and because the threshold is chosen on predicted probabilities, those probabilities have to be calibrated for the chosen cutoff to mean what the reviewer thinks it means. Competent teams fall for the wrong number because accuracy is the default a hundred tutorials reach for, it is a single comfortable figure, and on a balanced toy problem it is even reasonable. The discipline is to derive the metric from the decision and its costs, and to always print the naive baseline next to it.

Diagrams

Problem — how the wrong number ships and hides:

sequenceDiagram
    autonumber
    participant DS as Data Science
    participant RB as Review Board
    participant M as Fraud Model
    participant F as Fraud Ops
    DS->>RB: Report 97% accuracy
    Note over RB: Never asks base rate<br/>(fraud is 3%)
    RB->>M: Approve, ship to auth path
    M--xF: Misses 92% of fraud<br/>(8% recall)
    Note over M: No alarm — accuracy<br/>still reads 97%
    F->>RB: Chargeback losses flat,<br/>not falling
    Note over DS,F: Found in loss report,<br/>not in the eval

Solution — evaluate against the decision, not the average:

flowchart TD
    A["New fraud model"] --> G1["Decision metric:<br/>recall at threshold +<br/>expected loss (not accuracy)"]
    A --> G2["Confusion matrix at<br/>the live threshold"]
    A --> G3["Calibration check<br/>(ECE &lt; 0.03)"]
    A --> G4["Naive-baseline compare<br/>(never-fraud = 97%)"]
    G1 -.-> GATE["Ship gate: must beat<br/>the naive baseline on<br/>the decision metric"]
    G2 -.-> GATE
    G3 -.-> GATE
    G4 -.-> GATE
    GATE --> P["Promote only if it<br/>catches real fraud"]

What good looks like

The lesson

A metric means nothing until you know what a trivial model scores on it — and on an imbalanced problem with asymmetric costs, accuracy is a number a constant can beat you at. Choose the metric from the decision and its costs, show the confusion matrix at the threshold you'll actually run, and always print the naive baseline beside the headline.

Named concepts: class imbalance, accuracy paradox, precision/recall at the operating point, PR-AUC, cost-weighted evaluation, probability calibration.

Real-world echoes

Transfer

For your highest-stakes classifier on a rare event — fraud, default, churn, a rare disease flag — what does a "predict the majority class" model score on your headline metric? If you don't know, you can't tell whether your model is working or whether you're celebrating the number for doing nothing.

Make it a ticket: for one imbalanced classifier, replace the headline metric with recall-at-threshold plus cost-weighted expected loss, add the confusion matrix at the live threshold and the naive-baseline score to the standard review slide, and gate promotion on beating that baseline on the decision metric.

Related