The F1 score is calculated as 2 × precision × recall ÷ (precision + recall), the β = 1 case of the F-measure in the scikit-learn documentation.
Because F1 is a harmonic mean, a very low value on either side pulls the score down. When positive cases are rare, a model that finds every positive case but flags everything gets a low F1, and so does a model that is almost always right when it flags but finds very few cases.
CUBIG’s UCI Polish Companies Bankruptcy experiment (October 2026) shows how F1 moves. With the model settings unchanged, a random forest’s F1 rose from 0.41 to 0.61 after data preparation. Recall rose from 26.2% to 48.5%, while precision fell from 93.1% to 82.0%.
When F1 is a useful summary:
- the positive outcome is rare, so accuracy would look high even for a model that finds few cases
- misses and false alarms both matter, and the team wants one number to track while it compares versions
- the comparison holds the evaluation records and the threshold fixed
How is the F1 score different from accuracy?
- Accuracy counts every correct prediction, including the many correct negatives in an imbalanced dataset.
- F1 ignores true negatives and looks only at how the positive class is handled, through precision and recall.
- On rare outcomes, F1 is usually the more informative of the two, but F1 alone still hides which of the two errors changed.
Where does the F1 score break in AI work?
F1 weighs misses and false alarms equally. A fraud team that can review only a fixed number of alerts a day, or a screening team that cannot afford a missed case, usually does not value the two errors equally, so the same F1 can mean a good model for one team and a poor one for the other.
In the four comparisons highlighted in CUBIG’s summary of five data preparation experiments, F1 rose while false alarms also grew, a trade-off F1 alone would not show. Read F1 with recall, precision and the confusion matrix counts. A higher F1 is a reason to check those counts against the task’s acceptance criteria, not a pass by itself.