📊

F1 Score & Precision-Recall Calculator

Calculate F1 score, precision, recall, specificity, and accuracy from a binary classification confusion matrix (TP, FP, TN, FN).

Results

F1 Score84.21 %
Precision (PPV)80.00 %
Recall (Sensitivity)88.89 %
Overall Accuracy85.00 %
Specificity0.8,182

📖What is it?

F1 Score is the harmonic mean of Precision and Recall, offering a single balanced metric for binary classifiers: F1 = 2 × (Precision × Recall) / (Precision + Recall). Precision = TP / (TP + FP); Recall = TP / (TP + FN). F1 is preferred over accuracy on imbalanced datasets.

🎯How to use

Enter the four values from your model's confusion matrix. True Positives (correctly identified positives), False Positives (negatives incorrectly labelled positive), True Negatives (correctly identified negatives), and False Negatives (positives incorrectly labelled negative).

💡Example scenario

A fraud detection model scores: TP=80, FP=20, TN=90, FN=10. Precision = 80/100 = 80%. Recall = 80/90 = 88.9%. F1 = 2×0.80×0.889/(0.80+0.889) = 84.2%. Despite 85% accuracy, the F1 reveals the precision-recall trade-off more clearly.

🏆Pro tip

A high precision means few false alarms; high recall means few missed detections. For medical diagnosis, maximise recall (missing a disease is worse). For spam filters, balance both. F1 near 1.0 = excellent; below 0.5 = model needs improvement.