In statistical analysis of binary classification, the F1 score (also F-score or F-measure) is a measure of a test's accuracy. It considers both the precision p and the recall r of the test to compute the score: p is the number of correct positive results divided by the number of all positive results, and r is the number of correct positive results divided by the number of positive results that should have been returned. The F1 score can be interpreted as a weighted average of the precision and recall, where an F1 score reaches its best value at 1 and worst at 0.
The traditional F-measure or balanced F-score (F1 score) is the harmonic mean of precision and recall — multiplying the constant of 2 scales the score to 1 when both recall and precision are 1:
The general formula for positive real β is:
The formula in terms of Type I and type II errors:
Two other commonly used F measures are the measure, which weighs recall higher than precision (by placing more emphasis on false negatives), and the measure, which weighs recall lower than precision (by attenuating the influence of false negatives).
The F-measure was derived so that "measures the effectiveness of retrieval with respect to a user who attaches β times as much importance to recall as precision". It is based on Van Rijsbergen's effectiveness measure
Their relationship is where .
The F1 score is also known as the Sørensen–Dice coefficient or Dice similarity coefficient (DSC).
|total population||prediction positive||prediction negative||Prevalence = Σ condition positive/|
|True Positive (TP)||False Negative (FN)
(type II error)
|True Positive Rate (TPR), Sensitivity, Recall, Probability of Detection = Σ TP/||False Negative Rate (FNR), Miss Rate = Σ FN/|
|False Positive (FP)
(Type I error)
|True Negative (TN)||False Positive Rate (FPR), Fall-out, Probability of False Alarm = Σ FP/||True Negative Rate (TNR), Specificity (SPC) = Σ TN/|
|Accuracy = Σ TP + Σ TN/||Positive Predictive Value (PPV), Precision = Σ TP/||False Omission Rate (FOR) = Σ FN/||Positive Likelihood Ratio (LR+) = TPR/||Diagnostic Odds Ratio (DOR) = LR+/|
|False Discovery Rate (FDR) = Σ FP/||Negative Predictive Value (NPV) = Σ TN/||Negative Likelihood Ratio (LR−) = FNR/|
The F-score is often used in the field of information retrieval for measuring search, document classification, and query classification performance. Earlier works focused primarily on the F1 score, but with the proliferation of large scale search engines, performance goals changed to place more emphasis on either precision or recall and so is seen in wide application.
The F-score is also used in machine learning. Note, however, that the F-measures do not take the true negatives into account, and that measures such as the Matthews correlation coefficient, Informedness or Cohen's kappa may be preferable to assess the performance of a binary classifier.
- . 
This is also known as the Fowlkes–Mallows index.
- Precision and recall
- NIST (metric)
- ROUGE (metric)
- Word Error Rate (WER)
- Receiver operating characteristic
- Matthews correlation coefficient
- Uncertainty coefficient, aka Proficiency
- Sørensen–Dice coefficient
- Van Rijsbergen, C. J. (1979). Information Retrieval (2nd ed.). Butterworth.
- Powers, David M W (2011). "Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness & Correlation" (PDF). Journal of Machine Learning Technologies. 2 (1): 37–63.
- Beitzel., Steven M. (2006). On Understanding and Classifying Web Queries (Ph.D. thesis). IIT. CiteSeerX .
- X. Li; Y.-Y. Wang; A. Acero (July 2008). Learning query intent from regularized click graphs (PDF). Proceedings of the 31st SIGIR Conference.
- See, e.g., the evaluation of the CoNLL 2002 shared task.
- Li, Guo-Zheng, et al. "Inquiry diagnosis of coronary heart disease in Chinese medicine based on symptom-syndrome interactions." Chinese medicine 7.1 (2012): 1.