Harmonic Mean#
The reciprocal-based mean underlying the F1 score.
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 harmonic mean is an average that leans toward the smaller of the values — the reciprocal of the average of reciprocals. For two numbers it is:
It is always ≤ the arithmetic mean, and equal only when the values match.
Its key property#
It penalizes imbalance. Averaging precision 0.95 and recall 0.20, the arithmetic mean gives a rosy 0.575, but the harmonic mean gives ~0.33 — correctly flagging that one component is poor. A high harmonic mean requires all inputs to be high.
Where it’s used#
That property is exactly why the F1-score uses it to combine precision and recall, and why harmonic means are the right average for rates and ratios (speeds, P/E ratios) rather than additive quantities.
Theme: Classification & Averaging Metrics · All terminology
Hint
Mind map — connected ideas
F1-score · Mean · Average Precision (AP) · Precision (a.k.a. Positive Predictive Value, PPV) · Weighted Averaging · Macro Averaging
Hint
More in Classification & Averaging Metrics
Accuracy · AUC (Area Under the Curve) · Average Precision (AP) · Binary Classification · Classification Probability · Discriminatory Power · F1-score · Gini Coefficient · 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: Harmonic Mean (insightful-data-lab.com).