Accuracy vs. Precision vs. Recall
Accuracy alone is a misleading metric for most real-world classification tasks — precision and recall expose the specific failure modes that accuracy hides.
Accuracy and Its Limitations
Accuracy = (TP + TN) / Total. It is easy to interpret but breaks down with imbalanced classes — a model that always predicts the majority class can achieve 99% accuracy while being completely useless for detecting the minority class.
The Imbalanced Class Problem
In fraud detection, only 0.1% of transactions are fraudulent. A model predicting "not fraud" for everything achieves 99.9% accuracy yet catches zero frauds. Precision and recall on the minority class reveal that this model is worthless for its intended purpose.
Precision and Recall
Precision = TP / (TP + FP): of all predicted positives, how many are truly positive? Recall = TP / (TP + FN): of all actual positives, how many did we catch?
Computing All Three Metrics
When to Prioritise Each
Prioritise precision when false positives are costly (e.g., spam filter — you don't want to block legitimate emails). Prioritise recall when false negatives are costly (e.g., cancer screening — you don't want to miss a true case). Use accuracy only when classes are balanced and both error types are equally costly.