What is F1 Score?
Answer
The F1 score is a metric for classification models that combines precision and recall into a single number, and it is particularly useful when classes are imbalanced. It is the harmonic mean of the two: precision measures how many positive predictions are correct, recall measures how many actual positives are found, and the harmonic mean punishes imbalance between them: a high F1 requires both to be high at once. A model with 99% precision but 10% recall scores poorly on F1, because the harmonic mean is dominated by the smaller of the two values. This makes F1 a stricter, more informative summary than accuracy or either component alone when false positives and false negatives both matter.
(1) Definition: The harmonic mean of precision and recall, one number summarizing both.
(2) Key Property: It is dominated by the lower component, so it cannot be gamed by maximizing only precision or only recall.
(3) When To Use: Imbalanced classes, or when false positives and false negatives carry comparable cost.

Figure 1: F1 contour lines over the recall–precision plane: to reach a higher F1 band you must improve both metrics: moving along one axis alone quickly flattens out.
Mathematical Formulation:
Where:
is
and
is
(see the precision-and-recall question).
,
, and
are the true positive, false positive, and false negative counts.
- The second line is the equivalent counts-only form;
does not appear, which is why F1 stays meaningful under class imbalance.
Leave a Reply