Written and maintained by CASRAI Editorial Board
Published
On this page
To interpret an F1 score, evaluate it as the harmonic balance between precision and recall on a scale from 0.0 to 1.0, where 1.0 indicates perfect classification and 0.0 reflects total failure. Because the F1 score relies on the harmonic mean rather than an arithmetic average, it penalizes models that sacrifice either precision or recall, meaning a score of 0.80 or higher generally demonstrates strong predictive capability only when baseline class imbalance, false alarm costs, and decision thresholds are accounted for within the operational context.
Definition: What Does the F1 Score Actually Measure?
The F1 score measures the harmonic balance between precision (positive predictive value) and recall (sensitivity) in classification models. In machine learning, overall accuracy often misleads on imbalanced data because a naive model predicting only the majority negative class can achieve high accuracy while detecting zero true positives. The F1 score resolves this issue by focusing exclusively on positive predictions and actual positive occurrences, ignoring the distorting effect of large true negative counts. For algebraic derivations of the core formulas, see the F1 score formula guide.
Formulated by C. J. van Rijsbergen in 1979 for information retrieval, the metric combines precision and recall through a harmonic mean. Unlike an arithmetic mean, the harmonic mean is driven by the lower number. If a classifier achieves precision of 0.95 but recall of 0.20, its arithmetic mean is 0.575, whereas its F1 score plunges to 0.330. This ensures a model cannot post a misleadingly high score by trading away one dimension entirely.
Confusion Matrix Foundations: What Is TP FP TN FN?
Interpreting an F1 score requires understanding the four fundamental classification outcomes in a confusion matrix: True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN). Every binary decision rule partitions test instances into these four discrete quadrants based on ground truth and predictions.
| Confusion Matrix Term | Statistical Definition | Classification Role | Operational Impact |
|---|---|---|---|
| True Positive (TP) | Condition present and algorithm predicts positive | Correct positive detection; forms numerator of precision and recall | Successful intervention, correct diagnosis, or valid alert |
| False Positive (FP) | Condition absent but algorithm predicts positive (Type I error) | False alarm; increases denominator of precision | Wasted investigative resources, alert fatigue, unnecessary tests |
| True Negative (TN) | Condition absent and algorithm predicts negative | Correct negative rejection; omitted entirely from F1 score | Unimpeded baseline operation, normal triage confirmation |
| False Negative (FN) | Condition present but algorithm predicts negative (Type II error) | Missed positive case; increases denominator of recall | Undetected pathology, unintercepted fraud, security breach |
A defining property of the F1 score is that True Negatives (TN) do not appear in its formula. In web search, document retrieval, or network monitoring, irrelevant negative instances are vast. Including TN would make almost any model look flawless. However, omitting TN also creates interpretative blind spots when negative errors carry tangible operational penalties.
The Four Key Evaluation Metrics Used in Classification
When assessing a classifier, analysts examine four key evaluation metrics: Precision, Recall, Specificity, and F1 Score. No single metric captures every aspect of performance, and interpreting F1 correctly requires examining it alongside its related measures. Consult our precision and recall formula guide for detailed algebraic proofs.
- Precision (Positive Predictive Value): Precision equals TP / (TP + FP). It measures the proportion of positive flags that are correct, indicating whether positive predictions can be trusted.
- Recall (Sensitivity / True Positive Rate): Recall equals TP / (TP + FN). It measures the fraction of actual positive cases identified, showing how thoroughly the model catches target conditions.
- Specificity (True Negative Rate): Specificity equals TN / (TN + FP). It measures the fraction of negative cases cleared, monitoring false alarms across large negative cohorts.
- F1 Score: The harmonic mean balancing precision and recall into a single summary figure.
- Overall Accuracy: Accuracy equals (TP + TN) / (TP + FP + TN + FN). Although common, accuracy fails on imbalanced data, where majority-class rejections hide minority-class failure.
For probabilistic classifiers that output continuous confidence scores, calibration metrics like the Brier score evaluation help verify whether predicted probabilities match empirical observation frequencies before applying a hard threshold.
Formula and Mathematical Derivation
The standard F1 score formula combines precision (P) and recall (R):
F1 = 2 × (Precision × Recall) / (Precision + Recall)
Substituting precision as TP / (TP + FP) and recall as TP / (TP + FN) gives the direct count-based equation:
F1 = 2TP / (2TP + FP + FN)
Each variable represents an exact integer count of classified observations:
- TP (True Positives): Positive instances correctly identified.
- FP (False Positives): Negative instances incorrectly labeled as positive.
- FN (False Negatives): Positive instances incorrectly labeled as negative.
- Multiplier 2: Scales the harmonic mean so that when Precision = 1.0 and Recall = 1.0, F1 equals 1.0.
The metric generalises to the Van Rijsbergen F-beta formula, where beta adjusts the relative weight of recall versus precision:
F_beta = (1 + beta²) × (Precision × Recall) / ((beta² × Precision) + Recall)
Setting beta = 1 gives equal weight to both, yielding the F1 score. Setting beta = 2 (F2 score) weights recall twice as heavily, common in clinical screening. Setting beta = 0.5 (F0.5 score) weights precision twice as heavily, common in automated search filtering.
Worked Example: Comparing Two Classifiers with the Arithmetic Shown
To see why an F1 score must never be interpreted without examining precision and recall, consider two algorithms tested on 1,000 cases with 10% positive prevalence (100 positive cases and 900 negative cases).
| Performance Metric | Classifier A (High Precision) | Classifier B (High Recall) |
|---|---|---|
| True Positives (TP) | 72 | 88 |
| False Positives (FP) | 8 | 32 |
| False Negatives (FN) | 28 | 12 |
| True Negatives (TN) | 892 | 868 |
| Precision [TP / (TP + FP)] | 72 / 80 = 0.900 (90.0%) | 88 / 120 = 0.733 (73.3%) |
| Recall [TP / (TP + FN)] | 72 / 100 = 0.720 (72.0%) | 88 / 100 = 0.880 (88.0%) |
| Calculated F1 Score | 2 × (0.900 × 0.720) / (0.900 + 0.720) = 1.296 / 1.620 = 0.800 | 2 × (0.7333 × 0.8800) / (0.7333 + 0.8800) = 1.2907 / 1.6133 = 0.800 |
Both models produce an identical F1 score of exactly 0.800, yet their operational behaviors are completely different:
- Operational Profile of Classifier A: Generates only 8 false alarms with 90.0% precision, but misses 28 out of 100 positive cases (recall 72.0%). In disease screening where missed diagnoses lead to patient deterioration, this model is unacceptable.
- Operational Profile of Classifier B: Catches 88 out of 100 positive cases (recall 88.0%) with 32 false alarms (precision 73.3%). In clinical triage where follow-up confirmation is inexpensive, Classifier B is far superior.
- Interpretation Takeaway: F1 indicates summary balance, but the balance point dictates whether the algorithm is fit for purpose.
How to Interpret F1 Score Values: Is an F1 Score of 0.8 Good?
Whether an F1 score of 0.8 is good depends on class prevalence, the relative costs of false positives versus false negatives, and the difficulty of the problem domain. While general benchmarks offer baseline guidance, universal thresholds are invalid in practice.
| F1 Score Interval | Quality Benchmark | Representative Context | Recommended Analytical Action |
|---|---|---|---|
| 0.90 to 1.00 | Outstanding / Benchmark Level | Controlled optical character recognition, clear biomedical entity extraction | Audit for data leakage or test set contamination; confirm out-of-distribution stability. |
| 0.80 to 0.89 | Strong / Production-Grade | Information retrieval, text classification, mature fraud detection pipelines | Examine precision-recall split; tune probability threshold against error costs. |
| 0.65 to 0.79 | Moderate / Usable with Review | Complex clinical phenotyping, customer churn prediction, sentiment analysis | Incorporate human-in-the-loop review; conduct targeted feature engineering on error subsets. |
| 0.40 to 0.64 | Fair / High Noise Domain | Rare disease detection (prevalence under 0.5%), extreme class skew | Compare against random guessing baseline; an F1 of 0.50 can represent substantial lift. |
| 0.00 to 0.39 | Poor / Inadequate | Failure to learn underlying signal; model collapse or uninformative features | Re-examine labels, test non-linear architectures, or apply cost-sensitive loss formulations. |
When evaluating an F1 score against these intervals, consider three decisive structural factors:
- Baseline Prevalence: A random guesser on a dataset with positive prevalence p achieves expected precision p and recall p, giving an expected F1 of p. When p = 0.01 (1%), an F1 of 0.50 represents a fifty-fold improvement over chance. On a balanced 50/50 dataset, random guessing already yields 0.50, meaning an F1 of 0.60 is marginal.
- Asymmetric Error Costs: If false positives waste brief reviewer time while false negatives cause systemic security failure, an F1 of 0.80 driven by low recall is unacceptable. Optimization must shift toward an F2 score or threshold recalibration.
- Decision Threshold Sensitivity: Classifiers apply a default probability cutoff of 0.50. Shifting this threshold alters precision and recall substantially. Constructing a curve using our ROC curve analysis guide reveals whether an F1 can be elevated through threshold tuning without model re-training.
Assumptions, Limitations, and Common Pitfalls
Despite its popularity, the F1 score carries structural limitations that risk invalidating evaluation conclusions if overlooked.
The True Negative Blind Spot (Chicco and Jurman 2020)
Because the F1 score formula completely omits True Negatives (TN), it fails to evaluate negative class performance. In a study published in BMC Genomics, Davide Chicco and Giuseppe Jurman (2020) showed that a classifier can produce a high F1 score despite misclassifying a substantial fraction of negative cases. If negative class accuracy is crucial to system safety, relying solely on F1 provides a deceptively optimistic assessment.
Chicco and Jurman established that the Matthews Correlation Coefficient (MCC) offers a more dependable summary metric across imbalanced binary datasets. Ranging from -1.0 to +1.0, MCC incorporates all four confusion matrix quadrants proportionally:
MCC = (TP × TN – FP × FN) / √((TP + FP)(TP + FN)(TN + FP)(TN + FN))
When auditing imbalanced classification problems, analysts should report MCC alongside F1. A high F1 combined with a low MCC signals that the algorithm generates excessive false alarms across the negative cohort.
Multiclass Averaging Strategies: Macro, Micro, and Weighted F1
In multiclass evaluation, reporting an F1 score is ambiguous without specifying the aggregation method:
- Macro F1: Computes F1 for each class separately and calculates their unweighted arithmetic mean. It treats all classes equally, making it the most stringent indicator of rare-class performance.
- Micro F1: Sums total TP, FP, and FN across all classes before calculating a single metric. In single-label multiclass models, micro F1 is mathematically identical to accuracy, concealing severe failure on rare classes.
- Weighted F1: Averages per-class F1 scores weighted by class support. While representative of population frequencies, it allows majority classes to dominate the final metric.
Disambiguation: Machine Learning F1 Score vs. Piotroski F-Score in Finance
In quantitative research, the machine learning F1 score is frequently confused with the financial ‘F-Score’ (Piotroski F-Score). These are fundamentally distinct concepts developed for different analytical objectives:
- Machine Learning F1 Score: Developed from C. J. van Rijsbergen’s 1979 information retrieval literature, this continuous metric between 0.0 and 1.0 evaluates algorithmic classification precision and recall.
- Piotroski F-Score: Devised by Stanford accounting professor Joseph D. Piotroski in 2000, this discrete integer score between 0 and 9 measures corporate fundamental strength in equity investing. It grades firms across nine balance-sheet criteria covering profitability, leverage, and operating efficiency. A score of 8 or 9 signifies strong financial health, whereas 0 to 2 indicates distress.
Researchers evaluating predictive models in financial technology must clearly disambiguate whether ‘F-score’ refers to algorithmic classification balance or fundamental corporate solvency.
How to Report F1 Scores in APA Style
Under American Psychological Association (APA 7th edition) guidelines, quantitative reporting requires transparency regarding model specifications, sample sizes, class distributions, and evaluation parameters. Follow these reporting standards:
- Italicize statistical notation (F₁, P, R), rendering the digit 1 in subscript.
- Always report F1 alongside its constituent precision and recall values.
- In multiclass settings, specify whether the score is macro-averaged, micro-averaged, or weighted.
- Provide 95% confidence intervals generated through cross-validation or bootstrapping.
- Document the exact classification threshold applied (e.g., cutoff = .50).
Standard APA Reporting Example:
‘The random forest classifier demonstrated robust predictive performance on the test cohort (N = 1,200), achieving an overall macro-averaged F₁ score of .814, 95% CI [.788, .840]. Macro-averaged precision was .842, 95% CI [.815, .869], and macro-averaged recall was .788, 95% CI [.759, .817], applying a decision threshold of .50. For the minority clinical outcome (prevalence = 8.5%), the model achieved an F₁ score of .765 (precision = .810, recall = .725), significantly exceeding the zero-rule baseline F₁ of .085.’
How to Calculate and Interpret F1 Score in Python, R, and Excel
The following snippets demonstrate how to compute and verify the F1 score in standard analytical environments.
Python (scikit-learn)
In Python, scikit-learn computes binary and multiclass F1 scores directly. For comprehensive parameter options, see our guide on sklearn F1-score implementation.
from sklearn.metrics import f1_score, classification_report
y_true = [1, 1, 1, 1, 1, 0, 0, 0, 0, 0]
y_pred = [1, 1, 1, 0, 0, 0, 0, 0, 1, 0]
binary_f1 = f1_score(y_true, y_pred, average='binary')
print('Binary F1 Score:', round(binary_f1, 3))
print(classification_report(y_true, y_pred, digits=3))
R Environment
In R, analysts can calculate F1 directly from confusion matrix cell counts using standard assignment syntax:
actual = factor(c(1, 1, 1, 1, 1, 0, 0, 0, 0, 0))
predicted = factor(c(1, 1, 1, 0, 0, 0, 0, 0, 1, 0))
cm = table(Predicted = predicted, Actual = actual)
tp = cm['1', '1']
fp = cm['1', '0']
fn = cm['0', '1']
precision = tp / (tp + fp)
recall = tp / (tp + fn)
f1 = 2 * (precision * recall) / (precision + recall)
cat(sprintf('Precision: %.3f, Recall: %.3f, F1: %.3fn', precision, recall, f1))
Microsoft Excel
In Excel, if cell B2 contains True Positives, cell B3 contains False Positives, and cell B4 contains False Negatives, use the count formula:
= (2 * B2) / ((2 * B2) + B3 + B4)
If Precision is computed in cell C2 and Recall in cell C3, use Excel’s built-in harmonic mean function:
= HARMEAN(C2, C3)
Frequently asked questions
What does the F1 score actually measure?
The F1 score measures the harmonic balance between precision and recall in classification models. It assesses how effectively an algorithm detects positive cases without creating excessive false alarms, penalizing models that achieve high recall by sacrificing precision or vice versa.
What is TP FP TN FN?
These four abbreviations denote the outcomes of a confusion matrix: True Positives (TP) are correct positive identifications; False Positives (FP) are false alarms (Type I error); True Negatives (TN) are correct negative rejections; and False Negatives (FN) are missed positive cases (Type II error).
What are the four key evaluation metrics used in classification?
The four primary evaluation metrics are Precision (TP / [TP + FP]), Recall (TP / [TP + FN]), Specificity (TN / [TN + FP]), and F1 Score (the harmonic mean of Precision and Recall). Overall Accuracy is also tracked but is easily distorted by class imbalance.
Is an F1 score of 0.8 good?
An F1 score of 0.8 is generally considered strong performance, but its practical adequacy depends on class prevalence and error costs. In rare-event fraud detection with 0.1% prevalence, 0.8 is outstanding; in critical medical screening, an F1 of 0.8 with a 72% recall may be dangerously low.
Why is the harmonic mean used instead of the arithmetic mean?
The harmonic mean is used because it heavily penalizes extreme imbalances between precision and recall. If a model exhibits high precision but near-zero recall, the harmonic mean approaches zero, whereas an arithmetic mean would misleadingly suggest moderate performance.
What is the difference between macro F1 and micro F1 scores?
Macro F1 calculates the F1 score for each class independently and computes their unweighted average, treating rare and common classes equally. Micro F1 aggregates global counts across all classes, reflecting performance dominated by frequent classes.
How does the machine learning F1 score differ from the Piotroski F-Score?
The machine learning F1 score is a continuous statistical metric between 0.0 and 1.0 evaluating classification balance. The Piotroski F-Score is a discrete 9-point financial score developed by Joseph Piotroski to evaluate corporate balance-sheet strength in value investing.
The data table below compares classification evaluation metrics across confusion matrix components, sensitivity to class imbalance, and recommended research use cases.
Sources
- Scikit-learn Developers: f1_score — scikit-learn 1.9.1 documentation, checked 2026-11-23
- BioMed Central (BMC Genomics): The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation, checked 2026-11-23
- National Institute of Standards and Technology (NIST): SP 800-168, Approximate Matching: Definition and Terminology, checked 2026-11-23
- arXiv: The MCC-F1 curve: a performance evaluation technique for binary classification, checked 2026-11-23
- U.S. Food and Drug Administration (FDA): Clinical Decision Support Software Guidance, checked 2026-11-23
Data: Binary Classification Evaluation Metrics Comparison
Comparative analysis of binary classification evaluation metrics, detailing formula inputs, confusion matrix representation, sensitivity to class imbalance, and recommended application domains compiled from scikit-learn documentation, NIST SP 800-168, and peer-reviewed methodology literature.
Period covered: 2026. Coverage: Global.
| Metric Name (name) | Mathematical Basis (formula) | Matrix Inputs (quadrants) | Includes TN (boolean) | Output Range (interval) | Imbalance Sensitivity (behavior) | Recommended Domain (context) |
|---|---|---|---|---|---|---|
| F1 Score | 2 * (Precision * Recall) / (Precision + Recall) | TP, FP, FN | No | 0.0 to 1.0 | Sensitive to positive-class balance; invariant to negative prevalence changes | Imbalanced datasets where the positive class is the primary target and true negatives have low operational utility |
| Accuracy | (TP + TN) / (TP + FP + TN + FN) | TP, FP, TN, FN | Yes | 0.0 to 1.0 | Severely distorted; majority-class overoptimism | Balanced datasets with roughly equal class frequencies and symmetric costs for false predictions |
| Matthews Correlation Coefficient (MCC) | (TP*TN - FP*FN) / sqrt((TP+FP)*(TP+FN)*(TN+FP)*(TN+FN)) | TP, FP, TN, FN | Yes | -1.0 to +1.0 | Robust; balanced evaluation across all four confusion matrix quadrants | Severely imbalanced binary classification where both positive and negative classifications carry critical significance |
| Balanced Accuracy | (Sensitivity + Specificity) / 2 | TP, FP, TN, FN | Yes | 0.0 to 1.0 | Adjusted; arithmetic mean of per-class recall | Multiclass or binary evaluation where equal weight must be assigned to each class regardless of sample frequencies |
| Precision (Positive Predictive Value) | TP / (TP + FP) | TP, FP | No | 0.0 to 1.0 | Highly sensitive; drops as positive class prevalence declines | Applications where false alarms impose severe costs or human labor burdens (e.g. automated spam blocking, legal discovery) |
| Recall (Sensitivity) | TP / (TP + FN) | TP, FN | No | 0.0 to 1.0 | Invariant to negative class size; sensitive to missed positive instances | Screening and diagnostic tasks where false negatives produce catastrophic failure (e.g. disease diagnosis, critical fault detection) |
Sources
- f1_score — scikit-learn 1.9.1 documentation (accessed 2026-11-23)
- The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation | BMC Genomics | Springer Nature Link (accessed 2026-11-23)
- SP 800-168, Approximate Matching: Definition and Terminology | CSRC (accessed 2026-11-23)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







