Skip to content
Quantoros

What are precision, recall, and F1-score?

Classic MLLevel: FoundationClassification

What are precision, recall, and F1-score?

Hints
  • Write TP, FP, TN and FN for a small example.
  • Separate ranking quality, threshold selection and probability calibration. Which error costs more?

Answer

  • Precision and recall are classification evaluation metrics:
  • P = TP / (TP + FP) and R = TP / (TP + FN).
  • Where TP is true positives, FP is false positives and FN is false negatives
  • In both cases the score of 1 is the best: we get no false positives or false negatives and only true positives.
  • F1 is a combination of both precision and recall in one score (harmonic mean):
  • F1 = 2 * PR / (P + R).
  • Max F score is 1 and min is 0, with 1 being the best.

Source and licence: Alexey Grigorev & contributors — Data Science Interviews · CC-BY-4.0

Related questions