ZhangZhihui's Blog  

The F1 score is a metric used to evaluate the performance of a classification model, especially when the classes are imbalanced.

It is the harmonic mean of two other metrics:

  • Precision: Of the items the model predicted as positive, how many were actually positive?

  • Recall: Of all actual positive items, how many did the model correctly identify?

Formula

1

Intuition

  • High precision but low recall → F1 is low

  • High recall but low precision → F1 is low

  • F1 is high only when both precision and recall are high

When to use it

  • When you need a single score that balances precision and recall

  • When the dataset is imbalanced and accuracy can be misleading

  • Common in spam detection, medical diagnosis, fraud detection, etc.

 

posted on 2025-11-30 16:29  ZhangZhihuiAAA  阅读(0)  评论(0)    收藏  举报