Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the F-Measure a harmonic mean and not an arithmetic mean of the Precision and Recall measures?

When we calculate the F-Measure considering both Precision and Recall, we take the harmonic mean of the two measures instead of a simple arithmetic mean.

What is the intuitive reason behind taking the harmonic mean and not a simple average?

like image 896
London guy Avatar asked Oct 14 '14 08:10

London guy


People also ask

Why is harmonic mean used instead of arithmetic mean?

The arithmetic mean is appropriate if the values have the same units, whereas the geometric mean is appropriate if the values have differing units. The harmonic mean is appropriate if the data values are ratios of two variables with different measures, called rates.

What is precision recall and F measure?

Precision quantifies the number of positive class predictions that actually belong to the positive class. Recall quantifies the number of positive class predictions made out of all positive examples in the dataset. F-Measure provides a single score that balances both the concerns of precision and recall in one number.

Which is greater arithmetic mean or geometric mean or harmonic mean?

Cheers! & (2) Harmonic mean is always lower than arithmetic mean and geometric mean. only if the values (or the numbers or the observations) whose means are to calculated are real and strictly positive.

What is the significance of F measure?

The F-score is commonly used for evaluating information retrieval systems such as search engines, and also for many kinds of machine learning models, in particular in natural language processing. It is possible to adjust the F-score to give more importance to precision over recall, or vice-versa.


3 Answers

To explain, consider for example, what the average of 30mph and 40mph is? if you drive for 1 hour at each speed, the average speed over the 2 hours is indeed the arithmetic average, 35mph.

However if you drive for the same distance at each speed -- say 10 miles -- then the average speed over 20 miles is the harmonic mean of 30 and 40, about 34.3mph.

The reason is that for the average to be valid, you really need the values to be in the same scaled units. Miles per hour need to be compared over the same number of hours; to compare over the same number of miles you need to average hours per mile instead, which is exactly what the harmonic mean does.

Precision and recall both have true positives in the numerator, and different denominators. To average them it really only makes sense to average their reciprocals, thus the harmonic mean.

like image 119
Sean Owen Avatar answered Oct 16 '22 09:10

Sean Owen


Because it punishes extreme values more.

Consider a trivial method (e.g. always returning class A). There are infinite data elements of class B, and a single element of class A:

Precision: 0.0
Recall:    1.0

When taking the arithmetic mean, it would have 50% correct. Despite being the worst possible outcome! With the harmonic mean, the F1-measure is 0.

Arithmetic mean: 0.5
Harmonic mean:   0.0

In other words, to have a high F1, you need to both have a high precision and recall.

like image 92
Has QUIT--Anony-Mousse Avatar answered Oct 16 '22 07:10

Has QUIT--Anony-Mousse


The above answers are well explained. This is just for a quick reference to understand the nature of the arithmetic mean and the harmonic mean with plots. As you can see from the plot, consider the X axis and Y axis as precision and recall, and the Z axis as the F1 Score. So, from the plot of the harmonic mean, both the precision and recall should contribute evenly for the F1 score to rise up unlike the Arithmetic mean.

This is for the arithmetic mean.

enter image description here

This is for the Harmonic mean.

enter image description here

like image 43
gadde saikumar Avatar answered Oct 16 '22 07:10

gadde saikumar