Class imbalance: when 99% accuracy means the model learned nothing
Fraud is 1 in 100 transactions. A model that flags nothing scores 99 percent accuracy and catches zero fraud. The metric is celebrating a model that does the opposite of its job.
Class imbalance: when 99% accuracy means the model learned nothing
Fraud runs at roughly 1 in 100 transactions. Build a model that flags none of them, ever, and it will score 99% accuracy. That number will look great in the deck. It will also mean the model caught zero fraud, which is the one thing it existed to do. Accuracy just congratulated a model for learning nothing.
Accuracy breaks on lopsided data
Accuracy is the share of predictions that are correct. When one class is 99% of your data, a model can be right 99% of the time by always guessing the majority and never once identifying the thing you care about. The metric rewards the laziest possible behavior, because on an imbalanced set, doing nothing is almost always right. So the higher the imbalance, the more misleading the accuracy figure becomes, right when the rare class matters most.
This is one of the easiest ways to ship a useless model that passes review. Everyone sees 99% and nobody asks 99% of what. The single number hid the only breakdown that mattered, which is how the model does on the 1% you built it for.
Fluency without accuracy, in another form
A growth strategist I talked to warns about AI that runs on vague prompts with no context: it produces content that sounds correct but does not convert. His line stuck with me. Fluency is not accuracy. Confident output is not the same as right output.
A 99% accuracy score on imbalanced data is the same illusion in a different costume. The number sounds authoritative. It reads as success. Underneath, the model is doing nothing useful, the way fluent copy that never converts is doing nothing useful. In both cases a smooth surface hides an empty result, and in both cases the fix starts with refusing to be reassured by the surface. Check whether the confident thing actually did the job.
Use metrics that see the rare class
Accuracy is the wrong tool here, so change the tool. Precision asks how many of the flagged transactions were truly fraud. Recall asks how much of the actual fraud you caught. On the do-nothing model, recall is zero, and that single number exposes in one line what 99% accuracy concealed. Look at the confusion matrix and the failure is obvious: every fraud case sits in the missed column. The information was always there. Accuracy just averaged it away.
Pick the metric that stares directly at the minority class, because that class is the reason the model exists. For fraud, recall on the fraud class is the number that decides whether the feature works. Overall accuracy is close to irrelevant.
Balance the evaluation data too
The metric is half the fix. The data is the other half. If your evaluation set is also 99 to 1, even a good metric is computed on almost no positive examples, so it swings wildly on a handful of cases and you cannot trust it. Build an evaluation slice with enough of the rare class to measure it stably, oversampling the minority so precision and recall rest on real numbers instead of three lucky examples. Report performance on the rare class as its own line, never folded into a global average that the majority dominates.
Do both and the picture gets honest fast. That 99% model reveals itself as 0% recall, and a genuinely useful model that flags fraud at the cost of a few false alarms finally looks better than the one that does nothing, which is exactly the ranking you wanted all along.
How we approach it at Density Labs
In the AI Opportunity Assessment, our fixed two week, $2,500 engagement, we check whether your data is imbalanced and whether your metric can see through it. A high accuracy number on a lopsided problem is a red flag we open up, not a result we accept. We look at precision and recall on the class that matters and confirm your evaluation set has enough of it to grade honestly.
On imbalanced data, accuracy is the number that lies most confidently. Measure the class you actually care about.