A student compares two colored blocks on a classroom balance.

F1 Score definition

The F1 score is the harmonic mean of classification precision and recall.

In Spanish
puntuación F1
Topic
Classification and evaluation

F1 Score in a picture

F1 Score diagramPrecision 0.8 and recall 0.5 give an F1 score of about 0.615.P = 0.8, R = 0.5Use precision and recall2PR = 0.8Multiply and double0.8 ÷ 1.3 ≈ 0.615Divide by the sum
Precision 0.8 and recall 0.5 give an F1 score of about 0.615.

How it works

With precision P and recall R, calculate 2PR/(P + R) when those inputs are defined and their sum is positive. Equivalently use 2TP/(2TP + FP + FN) when its denominator is positive. This gives a lower score when either precision or recall is low.

Worked examples

Find F1 when precision and recall both equal 0.75.

F1 = 0.75.

For TP = 12, FP = 3, FN = 8, calculate F1.

24/(24 + 3 + 8) = 24/35 ≈ 0.686.

If precision is 1 and recall is 0.25, what is F1?

2(1)(0.25)/(1 + 0.25) = 0.4.

Common mistake

The F1 score uses a harmonic mean. Its formula does not include true negatives.

Quick check

Which two rates does F1 combine?

Show answer

Precision and recall.

What is F1 when both rates equal 1?

Show answer

1.

What is F1 if TP = 0 but FP or FN is positive?

Show answer

0 by the count formula.

Sources

Flashcard

F1 Score

Reveal the definition

The F1 score is the harmonic mean of classification precision and recall.

Effortless Math. “F1 Score.” Math Dictionary.