three core classification metrics derived from the confusion matrix. Precision
P=TP+FPTP (of the samples predicted positive, how many are truly positive — “quality over quantity”); Recall
R=TP+FNTP (of the truly positive samples, how many were found — “better safe than sorry”);
F1=P+R2PR is their harmonic mean, summarizing both in one number; more generally
Fβ=β2P+R(1+β2)PR, where
β>1 weights recall more (e.g.
F2) and
β<1 weights precision more. The harmonic mean punishes imbalance:
P=1,R=0.1 gives
F1≈0.18, far below the arithmetic mean of 0.55.