Skip to content
Lambdian

F1 score

The harmonic mean of precision and recall: high only when both are high.

F1=2⋅precision⋅recallprecision+recallF_1 = \frac{2\cdot\text{precision}\cdot\text{recall}}{\text{precision} + \text{recall}}

The harmonic mean punishes imbalance: precision 1.0 with recall 0.1 gives an F1 of only 0.18. Use FβF_\beta to weight recall β\beta times as much as precision. For multi-class problems, average per-class F1 scores (macro treats classes equally, weighted by class size).

See it in action