Harmonic mean

The F1 score is based on the harmonic mean. The harmonic mean is defined as the reciprocal of the arithmetic mean of the reciprocals. Because of that, the result is not sensitive to extremely large values. If I use the F1 score as a metric, that classifier is going to get a low score.

The F1 score is the harmonic mean of precision and recall taking both metrics into account in the following equation: We use the harmonic mean instead of **a simple average because it punishes extreme values**. A classifier with a precision of 1.0 and a recall of 0.0 has a simple average of 0.5 but an F1 score of 0.