# F1 Score

*noun*

say it: **“EF WUN SKOR”** **/ˈɛf ˈwʌn ˈskɔr/**

A score from 0 to 1 that combines a model's precision and recall, high only when both are high.

## What is the **F1 score**?

The **F1 score** combines precision and recall into one number, their harmonic mean: 2 × P × R / (P + R). It's only
high when both are, so a model can't score well by being good at only one, which makes it handy when the positive
class is rare.

```python
from sklearn.metrics import f1_score
actual = [1, 0, 0, 1, 1, 0, 0, 0]
guessed = [1, 0, 0, 0, 0, 0, 0, 0]    # precision 1.0, recall 0.333
print(f1_score(actual, guessed))   # 0.5
```

## In a sentence

- “She compared the two fraud models by their **F1 score**.”
- “The **F1 score** of 0.5 showed that perfect precision couldn't make up for weak recall.”

Level: Journeyman · [More AI Basics terms at this level](https://www.ask-codey.com/glossary?category=ai&level=3)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/f1-score
