- Introduced by
- Multi-class evaluation community
- Year
- 2000s
- Type
- Evaluation metric
- Family
- Classification Metric
What does it do?
Micro-averaged F1 pools the true positives, false positives and false negatives across all classes and computes one F1-score from the pooled counts.
In single-label multi-class classification it reduces exactly to accuracy, so it is mainly a way of expressing overall correctness. Because the pooled counts are dominated by frequent classes, it says little about performance on rare ones.
The intuition behind the method
Micro-averaging treats every individual prediction as one decision and sums the per-class counts before computing precision and recall. A class with many examples therefore contributes more to the totals than a class with few. In single-label multi-class problems, each misclassified example adds one false positive for the predicted class and one false negative for the true class, so the total false positives and false negatives are equal. Precision and recall then both equal accuracy, and so does micro F1. For this reason a high micro F1 can coexist with very poor recall on a small class.
History
The originator of micro-averaging is not identified here. The distinction between pooling counts (micro) and averaging per-class scores (macro) is central to multi-class F1 evaluation, and the two are often reported together.
When to use it
Choose micro-averaged F1 when you evaluate a single-label multi-class classifier and the question is how often predictions are correct across all instances, with the test class mix representing the mix you expect in use. It is also a common choice when decisions are pooled across labels in a multi-label setting, although there it no longer equals accuracy. In that setting note that micro F1 uses only TP, FP and FN, so true negatives do not affect it. Do not use it as the headline metric when minority classes matter as much as frequent ones, for example rare defect or disease categories; use macro-averaged F1 or per-class results instead. Avoid comparing micro F1 values across test sets whose class proportions differ, because the value shifts with the class mix.
Limitations and considerations
- Pooled counts give large classes more weight, so poor performance on a small class has little effect on the score.
- In single-label multi-class settings it inherits accuracy's dependence on class prevalence.
- It cannot show which classes fail; a high value can coexist with near-zero recall for a rare class.
- In multi-label settings it no longer equals accuracy, and its meaning depends on how the labels are pooled.
- It ignores true negatives, so it does not reflect how well absent labels are handled.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- In single-label multi-class classification it equals accuracy, so readers who already know accuracy need no new interpretation.
- Pooling counts gives every individual prediction the same weight, which suits settings where each prediction counts equally.
- It summarises all classes in one number without requiring a per-class table.
Applications
- Single-label multi-class benchmarks whose test sets reflect the class mix expected in use.
- Monitoring the overall correctness of a classifier in production when the incoming class mix is stable.
- Multi-label tasks where decisions across labels are pooled, with the caveat that the value then differs from accuracy.
- A first overview of a classifier before examining per-class F1 scores or the confusion matrix.
How it works
How it works
Sum the true positives, false positives and false negatives over all classes, using the per-class counts from the confusion matrix or from one-vs-rest tables. Pooling the counts before computing any ratio is what distinguishes micro from macro averaging, where the criterion is computed per class first and then averaged. In micro-averaging each class is weighted by its frequency, so the performance is averaged over all examples.
Formula
TP=\sum_{i=1}^{L} TP_i,\quad FP=\sum_{i=1}^{L} FP_i,\quad FN=\sum_{i=1}^{L} FN_iCompute aggregate precision as the sum of TP over classes divided by the sum of (TP + FP) over classes, and aggregate recall as the sum of TP divided by the sum of (TP + FN). Then take their harmonic mean: 2 * P * R / (P + R). F1 is calculated from micro-precision and micro-recall, not from the classifications of individual examples. Written directly in pooled counts, this is 2*TP / (2*TP + FP + FN).
Formula
P=\frac{\sum_i TP_i}{\sum_i (TP_i+FP_i)},\quad R=\frac{\sum_i TP_i}{\sum_i (TP_i+FN_i)},\quad F_1=\frac{2PR}{P+R}=\frac{2TP}{2TP+FP+FN}The value ranges from 0 to 1, with higher values indicating more correct decisions overall. In single-label multi-class problems it equals accuracy, so it reads as an overall correctness rate that is driven by the most frequent classes. It does not show which classes fail; per-class F1 values are needed for that.
Common pitfalls
- Reporting micro F1 alone on an imbalanced dataset hides minority-class failures; report per-class F1 or macro F1 alongside it.
- Reporting micro F1 next to accuracy for a single-label multi-class result adds no information, because the two are equal.
- Confusing micro F1 with weighted F1: weighted F1 averages per-class F1 scores by class support and generally gives a different value. The name 'Frequency-weighted average F1' is used for weighted F1 and should not be used for micro F1.
Frequently asked questions
Is micro-averaged F1 really the same as accuracy?
For single-label multi-class classification, yes. Each misclassified example adds one false positive and one false negative, so pooled precision and recall both equal the proportion of correct predictions, and their harmonic mean is that same value. This equivalence does not hold in general for multi-label tasks.
When should I use micro F1 instead of macro F1?
Use micro F1 when each prediction, rather than each class, should count equally; in practice class frequency then drives the score. Use macro F1 when every class should count equally regardless of its size. With imbalanced classes macro F1 is often the safer choice, because it does not let frequent classes hide weak minority-class results.
Can macro and micro F1 differ significantly?
Yes. With imbalanced classes, macro F1 can be much lower than micro F1, because macro F1 gives each class equal weight while micro F1 is driven by the frequent classes. The gap is itself informative: a large one suggests uneven per-class performance that should be examined class by class.
Related methods
Sources
Powers, D. M. (2011). Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness and Correlation. Journal of Machine Learning Technologies, 2(1), 37-63.
Open publication referenceSokolova, M., Japkowicz, N., & Szpakowicz, S. (2006). Beyond Accuracy, F-Score and ROC: a Family of Discriminant Measures for Performance Evaluation. AI 2006, 4013, 1015-1021.
Open DOI referenceAn Introduction to Machine Learning (2017), Section 13.7, Eq. 13.2, p. ?