F1
lastmod 2026-10-13created 2026-03-315 edits
The F1 score is a metric that evaluates a model's accuracy in classification tasks using the harmonic mean of precision and recall.
This metric is useful when the dataset is imbalanced, that is, when samples of one class far outnumber samples of other classes.
The F1 score is expressed as a value between 0.0 and 1.0, and the closer it is to 1.0, the better the model performs.
Harmonic mean
The reciprocal of the arithmetic mean of the reciprocals of the given numbers. Mainly used to find an average rate of change
F1 Score expression
\(F1 = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}\)
- Precision: The proportion of items the model predicted as positive that are actually positive
- Recall: The proportion of actual positives that the model correctly predicted as positive
\(\text{Precision} = \frac{TP}{TP + FP}\)
\(\text{Recall} = \frac{TP}{TP + FN}\)
- True Positive (TP): The number of cases the model predicted as positive that are actually positive
- False Positive (FP): The number of cases the model predicted as positive that are actually negative
- True Negative (TN): The number of cases the model predicted as negative that are actually negative
- False Negative (FN): The number of cases the model predicted as negative that are actually positive
See Korean: 오차 행렬 (confusion matrix).