F1 Score
A metric that combines precision and recall into one balanced measure.
Combine the two rates from one tile inspection
In a fictional inspection, a camera flags ten tiles. Eight flagged tiles are cracked, and an independent check finds eight additional cracked tiles that the camera passed.
Precision · 80%
Eight correct flags out of ten total flags.
Recall · 50%
Eight detected cracks out of sixteen actual cracks.
F1 = 2 × (0.80 × 0.50) ÷ (0.80 + 0.50) ≈ 0.615, or 61.5%. The harmonic mean gives the lower rate more influence than a simple average would.
Read the two counts behind the score
Swapping the precision and recall values would give exactly the same F1. The work waiting for the inspector would be quite different. Keep the false-alarm and missed-defect counts beside the score when deciding which system to use. True negatives do not enter this binary F1 calculation.
Follow the idea
Precision explains the cost of reviewing the flagged tray.
Recall reveals the cracks the camera missed.
Related concepts
Source · scikit-learn’s guide to scoring predictions
Return to F1 Score in the A–Z glossary