1. The accuracy trap
Suppose 1% of transactions are fraud. A model that always predicts “not fraud” gets
It catches zero frauds.
The arithmetic is correct; the conclusion is wrong.
2. Confusion matrix first
predicted + predicted -
actual + TP FN
actual - FP TN
From these four counts we can ask meaningful questions:
Fraud detection may value recall because missed fraud is expensive. An alerting system may also care deeply about precision because too many false alarms make humans ignore it.
3. The threshold is a decision
A classifier often outputs a score or probability. Changing the decision threshold trades false positives against false negatives.
Do not treat 0.5 as a law of nature.
4. Training strategies
Possible responses include class-weighted losses, over/under-sampling, focal loss in some deep-learning settings, collecting more minority examples and threshold tuning based on deployment costs.
Never balance the test set merely to make the metric look nicer; evaluation should reflect the question you actually care about.
What to Remember
- Accuracy can hide minority-class failure.
- Inspect the confusion matrix.
- Precision and recall answer different operational questions.
- Thresholds and costs belong to the problem definition.
Next → Evaluation Metrics: which number should we use when different mistakes have different meanings?