Why using harmonic mean in F1 score

Jimmy (xiaoke) Shen
1 min readJun 30, 2021

--

Harmonic mean

Based on a nice explanation from [1]

The harmonic mean emphasizes the importance of smaller values;

in machine learning. The recall rate is R, and the accuracy rate is P. Using their evaluation of the algorithm, these two values ​​usually restrict each other. In order to evaluate the quality of the algorithm more conveniently. So the F1 value was introduced.

F1 is the harmonic mean of the accuracy rate P and the recall rate R. Why does F1 use harmonic averages instead of numerical averages. For example: when R is close to 1 and P is close to 0. The F1 value of the harmonic average is close to 0; and if the arithmetic average F1 is 0.5; obviously, the harmonic average can better evaluate the performance of the algorithm. Equivalent to evaluating the overall effect of R and P. Google translated from [1].

Reference

[1]如何理解与应用调和平均数? — 蓝绿黄红的回答 — 知乎 https://www.zhihu.com/question/23096098/answer/340657629

--

--