F1 Score Metric

What is F1 Score?

The F1 Score is the harmonic mean of precision and recall, providing a single metric that balances both.

Formula

F1 = 2 * (Precision * Recall) / (Precision + Recall)

Range

  • 0 to 1: Higher is better
  • 1.0: Perfect precision and recall
  • 0.5: Moderate performance
  • < 0.5: Poor performance

When to Use

  • Imbalanced classes (one class has many more samples)
  • When both false positives and false negatives are costly
  • Classification problems where accuracy might be misleading

Related Terms

  • Precision: True positives / predicted positives
  • Recall: True positives / actual positives
  • Accuracy: Overall correct predictions