F1-Score
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
F1 = 2·P·R/(P+R)
About this calculator
The F1-Score is a statistical measure used to evaluate the performance of classification models in machine learning. It calculates the harmonic mean between precision and recall, providing a balanced view of these two important metrics. The formula for calculating the F1-Score is 2·(Precision · Recall) / (Precision + Recall), where precision is the rate of true positives among all predicted positives and recall is the rate of true positives among all actual positives.
The F1-Score is particularly useful in situations where there is an imbalance between the classes of a dataset, or when the costs of false positives and false negatives are high. It provides a single metric that summarizes the performance of a classification model, making it easier to compare different models. However, it's essential to note that the F1-Score does not account for the rate of true negatives, which can be a limitation in certain contexts.
When using the F1-Score, it's crucial to consider the specific objectives of the problem being addressed. For example, in medical diagnostics, recall may be more important than precision, as it's critical to detect all positive cases. In other contexts, such as spam detection, precision may be more relevant. The F1-Score serves as a tool to balance these considerations.
A common caution when working with the F1-Score is to avoid optimizing it in isolation, without considering the broader context of the problem. Additionally, in cases of highly imbalanced classes, alternative metrics or adjustments to the formula may be necessary to obtain a more accurate assessment of model performance.
Frequently asked questions
What is F1-Score and what is it used for?
The F1-Score is a statistical measure that evaluates the performance of classification models in machine learning, calculating the harmonic mean between precision and recall.
When to use the F1-Score?
Use the F1-Score in situations of imbalanced classes or when the costs of false positives and false negatives are high, to get a balanced view of model performance.
What are the limitations of the F1-Score?
The F1-Score does not take into account the rate of true negatives and may not be suitable for all contexts, especially those with specific requirements for precision or recall.
How to interpret the F1-Score value?
A high F1-Score value indicates good model performance in terms of precision and recall. The value ranges from 0 to 1, with 1 being the best possible result.
Can the F1-Score be used to compare models?
Yes, the F1-Score is useful for comparing the performance of different classification models, providing a single and balanced metric.