F1-score#
The harmonic mean of precision and recall.
Important
✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
What it is#
The F1-score combines precision and recall into one number by taking their harmonic mean:
It ranges from 0 to 1, and is high only when both precision and recall are high.
Why harmonic#
Using the harmonic mean makes F1 penalize lopsided models — a classifier with 0.95 precision but 0.20 recall scores a low F1, unlike accuracy or a plain average. This makes F1 far more informative than accuracy on imbalanced data, and it deliberately ignores true negatives.
Its variants#
For multiclass problems, F1 is aggregated with micro, macro or weighted averaging; the general Fβ score tilts the balance toward recall (β > 1) or precision (β < 1) when the two errors carry different costs.
Theme: Classification & Averaging Metrics · All terminology
Hint
Mind map — connected ideas
Harmonic Mean · Precision (a.k.a. Positive Predictive Value, PPV) · Average Precision (AP) · Accuracy · Macro Averaging · Micro Averaging
Hint
More in Classification & Averaging Metrics
Accuracy · AUC (Area Under the Curve) · Average Precision (AP) · Binary Classification · Classification Probability · Discriminatory Power · Gini Coefficient · Harmonic Mean · Log Loss (also called Logarithmic Loss or Cross-Entropy Loss) · Macro AUC · Macro AUROC (Macro-Averaged AUROC) · Macro Averaging · Macro F1 · Macro Precision
See also
Source article Adapted (context, re-expressed) in our own words from: F1-score (insightful-data-lab.com).