Curvingo · Made in India

Glossary

Select one of the keywords on the left…

Precision and RecallSummary

Reading time: ~5 min

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
\dfrac{\text{TP}}{\text{TP} + \text{FP}}

Recall (sensitivity)
\dfrac{\text{TP}}{\text{TP} + \text{FN}}

F1-score
\dfrac{2PR}{P + R} = \dfrac{2\,\text{TP}}{2\,\text{TP} + \text{FP} + \text{FN}}

Accuracy and specificity
\dfrac{\text{TP} + \text{TN}}{\text{everyone}}, \qquad \dfrac{\text{TN}}{\text{TN} + \text{FP}}

Sina