Suvarna Garge (Editor)

F1 score

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In statistical analysis of binary classification, the F1 score (also F-score or F-measure) is a measure of a test's accuracy. It considers both the precision p and the recall r of the test to compute the score: p is the number of correct positive results divided by the number of all positive results, and r is the number of correct positive results divided by the number of positive results that should have been returned. The F1 score can be interpreted as a weighted average of the precision and recall, where an F1 score reaches its best value at 1 and worst at 0.

Contents

The traditional F-measure or balanced F-score (F1 score) is the harmonic mean of precision and recall — multiplying the constant of 2 scales the score to 1 when both recall and precision are 1:

F 1 = 2 1 1 r e c a l l + 1 p r e c i s i o n = 2 p r e c i s i o n r e c a l l p r e c i s i o n + r e c a l l .

The general formula for positive real β is:

F β = ( 1 + β 2 ) p r e c i s i o n r e c a l l ( β 2 p r e c i s i o n ) + r e c a l l .

The formula in terms of Type I and type II errors:

F β = ( 1 + β 2 ) t r u e   p o s i t i v e ( 1 + β 2 ) t r u e   p o s i t i v e + β 2 f a l s e   n e g a t i v e + f a l s e   p o s i t i v e .

Two other commonly used F measures are the F 2 measure, which weighs recall higher than precision (by placing more emphasis on false negatives), and the F 0.5 measure, which weighs recall lower than precision (by attenuating the influence of false negatives).

The F-measure was derived so that F β "measures the effectiveness of retrieval with respect to a user who attaches β times as much importance to recall as precision". It is based on Van Rijsbergen's effectiveness measure

E = 1 ( α P + 1 α R ) 1 .

Their relationship is F β = 1 E where α = 1 1 + β 2 .

Diagnostic Testing

This is related to the field of binary classification where recall is often termed as Sensitivity. There are several reasons that the F1 score can be criticized in particular circumstances.

Applications

The F-score is often used in the field of information retrieval for measuring search, document classification, and query classification performance. Earlier works focused primarily on the F1 score, but with the proliferation of large scale search engines, performance goals changed to place more emphasis on either precision or recall and so F β is seen in wide application.

The F-score is also used in machine learning. Note, however, that the F-measures do not take the true negatives into account, and that measures such as the Phi coefficient, Matthews correlation coefficient, Informedness or Cohen's kappa may be preferable to assess the performance of a binary classifier.

The F-score has been widely used in the natural language processing literature, such as the evaluation of named entity recognition and word segmentation.

G-measure

While the F-measure is the harmonic mean of Recall and Precision, the G-measure is the geometric mean.

G = p r e c i s i o n r e c a l l . G = P P V T P R .

This is also known as the Fowlkes–Mallows index.

References

F1 score Wikipedia