Home › Glossary › Evaluation › F1 Score

Beginner · Evaluation

F1 Score

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. The harmonic mean of precision and recall, balancing both into a single number.

Technical Definition

The harmonic mean of precision and recall, balancing both into a single number.

How it works

F1 = 2·P·R / (P+R). It punishes models that score high on only one of precision or recall, making it a popular choice for imbalanced classification. Variants include macro-F1 (average per class) and weighted-F1.

Related Concepts

  • Accuracy — The fraction of predictions a model gets correct on a labeled dataset.
  • Precision — Of the items the model predicted positive, the fraction that are actually positive.
  • Recall — Of all the actually positive items, the fraction the model successfully found.