F1 Score

Precision and recall folded into a single score

  • Basics
  • 6 min read
  • 2 diagrams

Key points

  • An F1 score folds how much of the real thing gets found and how much of what gets flagged is right into one number. It's handy when lining the two up side by side gets tedious.
  • It doesn't just split the difference between them. It's pulled toward whichever one is weaker.
  • So if either one is near rock bottom, the combined score sinks with it. Being great at only one side doesn't raise it.
  • It comes out highest when both are close together and both are strong.
  • The convenience has a cost: you can't tell which side dragged the score down just by looking at it.

The analogy

A loaded handcart rolls on two wheels. Both have to be firm for it to go anywhere.

Let one wheel go soft while the other stays firm, and the cart keeps veering off to one side until it stops. It doesn't matter how good the firm wheel is — it can't save the ride alone. Now, if you just took the two tire pressures and split the difference, you'd get a number that sounds decent. Look at that number alone, and you'd never guess the cart can't move.

Measuring an AI has a matching pair of numbers too: how much of the real thing actually gets found, and how much of what gets flagged is actually right. Favor only one, and you're in the same spot as the cart that won't roll.

F1 score folds these two together in a way that's pulled toward whichever one is weaker. Let one side sink, and the combined score sinks with it.

In detail

Two numbers can't rank a list

These two measures have names: precision for how much of what gets flagged is actually right, and recall for how much of the real thing actually gets found. Watching them side by side is the right instinct, but in practice you often need to collapse them into one. Picking which of ten candidate models to ship, or checking whether a change actually helped after tweaking a setting — both call for a single number.

Two candidates where one number goes up and the other goes down can't be ranked by the pair alone. Fold them into one score, and you can line candidates up on the spot. That's why F1 so often shows up as the last column on a scoreboard.

Why a plain average won't do

Picture a model that scores 100 percent on precision and close to 0 percent on recall. It only ever flags the one thing it's completely sure about, and lets nearly everything else slide right past. It's nearly useless — yet add the two numbers and halve them, and it walks away with close to 50.

F1 refuses to let that happen. It's pulled hard toward whichever of the two numbers is weaker, so when one side sits near zero the combined score sits near zero too. The model just described gets an F1 score near 0.

The name for this way of combining is harmonic mean. It's a way of scoring that gives no credit to the cart with one soft wheel, and only rewards the cart where both wheels are firm.

Highest when the two numbers are close together

Two candidates can add up to roughly the same total and still land on very different F1 scores. A model that's excellent on one measure and weak on the other scores lower than one that's solidly good on both, even when their totals would look similar side by side.

This is what makes F1 useful as a filter — it naturally screens out lopsided models. And it favors balance: pushing up whichever number is already weak moves the combined score more than polishing the one that's already strong. So balancing the two comes first — though which one is weaker, you can only tell from the two originals.

What the combined score hides

The convenience comes at a cost. Look at an F1 score on its own, and you can't tell whether it's the "found" side or the "flagged correctly" side that's dragging it down. The fix needed could be in opposite directions, and the combined score looks the same either way.

That's why a real scoreboard lists all three numbers side by side — the two originals plus F1. Use the combined score to narrow the field, then spread the original two back out for whatever candidates remain.

One side can be weighted more heavily

When missing something is far more costly, the combined score can be tilted to favor catching everything. When a wrong flag is more costly, it can tilt the other way instead. F1 is what you get when neither side is weighted more than the other.

A number attached to the name marks that weighting. A bigger number leans toward catching everything; a smaller one leans toward not flagging wrongly. Which one to use depends on which mistake — missing it, or flagging it wrongly — actually costs more.

More precisely

F1 score is the harmonic mean of the two measures — how much of the real thing gets found, and how much of what gets flagged is actually right. Because it's pulled hard toward the weaker of the two, being strong on only one side never raises it much. It's usually written as a plain number, though it sometimes appears as a percentage.

One thing to watch: this score gives no credit at all for correctly passing over something that isn't the thing you're looking for. That makes it a far more honest picture than a plain accuracy count whenever one side vastly outnumbers the other — but the number shifts depending on which side you defined as the target. Flip the target and you get a different score.

When there are several categories, F1 gets computed per category and then averaged. Weighting every category equally and weighting the categories with more data more heavily can pull that average in noticeably different directions.

The analogy breaks down in one place. A handcart's two wheels can be pumped up separately, but the two measures behind F1 are tied together. Move the line that decides what counts as a flag, and usually one number rises as the other falls — lifting both at once takes reworking the model or the training data itself.

Try it yourself

Common misconceptions

  • It's easy to think F1 is just the two measures added and halved, but actually it's a harmonic mean, pulled much harder toward whichever is weaker, so a rock-bottom score on either side drags the combined score to rock bottom too.

  • It's easy to think high accuracy means a high F1 too, but actually the two numbers count different things, so on data where one side vastly outnumbers the other, accuracy can be high while F1 is low.

  • It's easy to think one F1 score settles the evaluation, but actually the same score can call for opposite fixes, so the two original measures are worth checking side by side.

One-line summary

In short

F1 score folds how much of the real thing gets found and how much of what gets flagged is right into one number that's pulled toward whichever is weaker, so it only climbs when both are strong together.

Spotted an error or have a better analogy? Suggest an edit · Last updated 2026-10-17