Precision and RecallSummary
One page to revise from — the ideas first, then every formula you need.
- Accuracy can mislead. When one group is rare — 10 dengue cases among 200 people — a lazy model that always says "healthy" is 95 % accurate and useless.
- The confusion matrix sorts every prediction into four boxes: true positives, false negatives (misses), false positives (false alarms) and true negatives.
- Precision: when the model says positive, how often is it right? Recall (sensitivity): of all the real positives, how many did it catch?
- Moving the threshold trades one for the other. A lower threshold raises recall and lowers precision; no threshold makes both perfect.
- Choose by the cost of each mistake: when a miss is dangerous (screening, smoke alarms), favour recall; when a false alarm is costly (spam filters, fines), favour precision.
- The F1-score is the harmonic mean of precision and recall. It is high only when both are high, and it ignores the true negatives.
- Specificity is the share of real negatives that the model correctly clears.
Precision
Recall (sensitivity)
F1-score
Accuracy and specificity