Data Science & ML
Intermediate

F1 Score

Harmonic mean of precision and recall.

Formula

F1=2PrecisionRecallPrecision+RecallF_1 = 2\cdot\frac{Precision \cdot Recall}{Precision + Recall}

Variables

PrecisionPositive predictive value
RecallSensitivity

Example

P=0.8, R=0.6: F1 = 2(0.48/1.4) = 0.686

Did You Know?

The harmonic mean punishes extreme imbalance between precision and recall.