---
title: 'F1 score'
description: 'The harmonic mean of precision and recall.'
canonical_url: 'https://darkfactory.dev/glossary/f1-score'
markdown_url: 'https://darkfactory.dev/glossary/f1-score.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# F1 score


## Definition

The F1 score is the harmonic mean of precision and recall:

`F1 = 2 × (precision × recall) / (precision + recall)`

It is high only when both precision and recall are high. Because it ignores true negatives, F1 is often useful for imbalanced retrieval or detection tasks where the positive class matters more than overall accuracy.

One number still hides the tradeoff. Two systems can have the same F1 with different precision and recall, which can carry very different costs. Report the threshold, class definition, averaging method for multi-class tasks, and the component metrics.

## Distinguish it from nearby terms

Accuracy includes true negatives. F1 ignores them and weights precision and recall symmetrically. The more general F-beta family changes that weighting, while calibration measures whether predicted probabilities match observed frequencies.

## Check your understanding

System A has high precision and lower recall; System B reverses the pattern. Their F1 scores match, but A may suit an expensive investigation while B may suit safety screening where misses are costly.

## Related terms

- [Precision](https://darkfactory.dev/glossary/precision)
- [Recall](https://darkfactory.dev/glossary/recall)
- [Confusion matrix](https://darkfactory.dev/glossary/confusion-matrix)

## Evidence and further reading

- [Google Machine Learning Glossary](https://developers.google.com/machine-learning/glossary/)
