What is F1-score
F1-score is an evaluation metric for classifiers that represents the harmonic mean between precision and recall. It provides a single number to measure the balance between the quality of the positives identified and the ability not to miss real positives. The harmonic mean is stricter than the arithmetic mean, which penalizes cases where one of the metrics is very low.
How F1-score works
F1-score is calculated as twice the product of precision and recall divided by their sum. If either precision or recall is zero, the F1 will also be zero. This makes F1 reflect overall performance when the two metrics are similar. It is common to track precision and recall separately, in addition to F1, to get a complete picture.
Practical example
In a fraud detection system, there may be many non-fraudulent cases and few fraudulent ones. A model that gets most cases right but is poor at detecting real fraud can have high accuracy but low recall. F1 helps select the model that balances the quality of the positives it flags and the ability to find them in a challenging scenario.
What is F1-score used for
F1-score is used when we want a single quality indicator for imbalanced classification problems. It is useful in spam detection, fraud detection, medical diagnosis, and any task where false positives and false negatives are costly. As a standard metric, it helps compare models in a simple and interpretable way.
How to interpret F1-score
A high F1 indicates that the model balanced precision and recall well. A low F1 suggests that one of the metrics is weak and that the model needs adjustment. For example, if recall is low, the model is missing real positives. If precision is low, the model is flagging many false positives. F1 reveals the problem by showing that the two metrics are not aligned at the ideal.