Equivalence of Micro-Averaged Measures To Accuracy For Multi-Class Classification
In this guide, we’ll demystify how micro-averaged precision, recall, F1, and accuracy are related in multi‑class classification. Using the confusion matrix as a foundation, we’ll walk through precision, recall, F1 score, and accuracy, then prove why micro‑averaged precision, recall, F1, and accuracy become equivalent under certain conditions. If you’ve ever worked on or considered working on a multi-class classification project, you’ll notice something interesting. The model often produces the same values for Recall, Precision, F1 score, and accuracy consistently.
What you will learn (Overview):
- What is a confusion matrix table?
- A better understanding of Precision, Recall, F1, and Accuracy scores
- Micro-averaged and Macro-averaged Precision, Recall, F1 score, Accuracy
- Why for multi-class classification, micro-averaged Precision, micro-averaged Recall, and micro-averaged F1 score measures become the same as the Accuracy score?
If you’re unfamiliar with terms like Recall, Precision, F1 score, and Accuracy, let’s start by breaking them down. We need to understand why they can sometimes yield the same values. To grasp these concepts fully, we first need to delve into the confusion matrix.
What is a Confusion matrix table?

Here,
True Positive (TP): number of positive (1) predictions when they are actually positive (1)
False Positive (FP): number of positive (1) predictions when they are actually negative (0)
False Negative (FN): number of negative (0) predictions when they are actually positive (1)
True Negative (TN): number of negative (0) predictions when they are actually negative (0)
As illustrated in image 1, the confusion matrix provides a detailed breakdown of the classification model’s performance on the validation dataset. It shows the number of true and false predictions made by the classifier for both actual positive and negative instances. For simplicity, we will consider only two classes: Positive (1) and Negative (0).
What are Precision, Recall, F1 score, and Accuracy for classification
Now, let’s explore some metrics that can be derived from a confusion matrix.
Precision
The formula of the Precision is:
$$Precision = \frac{TP}{FP+TP}$$
Precision indicates how accurately our model has predicted a positive out of all predicted positives.
Recall
The formula of the Recall is:
$$Recall = \frac{TP}{FP+FN}$$
Recall calculates our model can predict how many positives out of all actual positives.
F1 score
The formula of the F1 score is:
$$F1 = \frac{2\times Precision\times Recall}{Precision + Recall}$$
The F1 score is calculated when both the above measures are important.
Accuracy
The formula for the Accuracy is:
$$Accuracy = \frac{TP+TN}{TP+TN+FP+FN}$$
F1 score vs accuracy
When comparing the F1 score to accuracy, consider a scenario where 90% of the test data belongs to the positive class and only 10% to the negative class. In this case, a model that simply predicts all data as positive would achieve a seemingly impressive 90% accuracy. However, this metric can be misleading, as it doesn’t reflect the model’s true performance, especially when dealing with imbalanced datasets.
This is where the F1 score becomes crucial. The F1 score is the harmonic mean of precision and recall, offering a more balanced evaluation by considering both false positives and false negatives. It’s particularly valuable for classification tasks with imbalanced data.
For multi-class classification, where there are more than two classes, the F1 score can be calculated by averaging the precision and recall of each class, providing a comprehensive assessment of the model’s effectiveness.
There are two methods for calculating a statistical average.
Macro Averaged
This method is so simple to calculate. Just take an average of the precision and recall of the individual class to calculate the macro-averaged precision and recall. Then, for the F1 score, take the harmonic mean of the precision and recall.
$$Macro\,Precision = \frac{Precision1 + Precision2}{2}$$
$$Macro\,Recall = \frac{Recall1 + Recall2}{2}$$
$$Macro\,F1\,Score = 2 \times \frac{(Macro\,Precision)\times (Macro\,Recall)}{(Macro\,Precision)\times(Macro\,recall)}$$
Micro Averaged
To calculate micro-precision or micro-recall, you sum all the true positives across classes and use this total in the numerator. In the denominator, you sum the corresponding measures, such as false negatives and false positives, based on the standard formulas for precision and recall. This method provides a way to aggregate the performance across all classes, offering a more holistic view of the model’s effectiveness.
$$Micro\,Precision = \frac{TruePostive1+TruePositive2}{TruePositive1 + FalsePositive1 + TruePositive2 + FalsePostive2}$$
$$Micro\,Recall = \frac{TruePositive1+TruePositive2}{TruePositive1 + FalseNegative1 + TruePositive2 + FalseNegative2}$$
$$Micro\,F1\,Score = 2\times\frac{Micro\,Precision\times Micro\,Recall}{Micro\,Precision + Micro\,Recall}$$
In multi‑class classification, micro-averaged precision, recall, and F1-score equal accuracy
The statement might seem confusing at first. How can that be true? Let’s dive in and break it down for a clearer understanding.
First, let’s reframe the accuracy formula specifically for two classes: Class A and Class B.
$$Accuracy = \frac{TP(A) + TP(B)}{TP(A) + TP(B) + FP(A) + FP(B)} = \frac{Total\,True\,predictions\,of\,class\,A\,and\,Class\,B}{Total\,Predictions}$$
Similarly, we can rewrite the micro-averaged precision formula in terms of two classes.
$$Pr(AB) = \frac{TP(A) + TP(B)}{TP(A) + TP(B) + FP(A) + FP(B)}$$
Now,
$$TP(A) + FP(A) = PP(A)$$
Where, PP(A) = Predicted Positives of class A = Total Predictions of class A
Similarly,
$$TP(B) + FP(B) = PP(B)$$
So,
$$Pr(AB) = \frac{TP(A) + TP(B)}{PP(A) + PP(B)} = \frac{Total\,True\,predictions\,of\,class\,A\,and\,Class\,B}{Total\,Predictions} = Acc(AB)$$
Similarly, for micro-averaged recall,
$$Re(AB) = \frac{TP(A) + TP(B)}{TP(A) + FN(A) + TP(B) + FN(B)} = \frac{Total\,True\,predictions\,of\,class\,A\,and\,Class\,B}{Total\,Predictions}$$
Now,
$$TP(A) + FN(A) = AP(A)$$
Where,
$$AP(A) = Actual\,Positives\,of\,class\,A = Total\,number\,of\,class\,A$$
Similarly,
$$TP(B) + FN(B) = AP(B)$$
So,
$$Re(AB) = \frac{TP(A) + TP(B)}{AP(A) + AP(B)} = \frac{Total\,True\,predictions\,of\,class\,A\,and\,Class\,B}{Total\,Predictions} = Acc(AB)$$
Now let’s prove for the F1 score,
$$F1(AB) = 2 \times \frac{Pr(AB) \times Re(AB)}{Pr(AB) + Re(AB)}$$
We have already proved that
$$Pr(AB) = Acc = Re(AB)$$
So, let’s put Pr(AB) instead of Re(AB) as they are equal.
$$F1(AB) = 2 \times \frac{Pr(AB) * Pr(AB)}{Pr(AB) + Pr(AB)} = 2 \times\frac{Pr(AB) ^ 2}{2 \times Pr(AB)}$$
So we can conclude that,
$$Pr(AB) = Re(AB) = F1(AB) = Acc(AB)$$
So, we can say that for multi-class classification, even with two classes, micro-averaged precision, recall, and f1 score are the same. They are equal to the accuracy of the classifier on the test data.
Summary:
In multi-class classification projects, it’s often observed that metrics like Recall, Precision, F1 score, and Accuracy can end up being the same. This blog delves into why this happens and explores these crucial performance metrics in depth.
You’ll learn about the confusion matrix, which breaks down model predictions into True Positives, False Positives, False Negatives, and True Negatives. We’ll dissect Precision (accuracy of positive predictions), Recall (coverage of actual positives), F1 score (balance between Precision and Recall), and Accuracy (overall correctness).
The blog explains the difference between Macro-averaged and Micro-averaged metrics. In multi-class settings, micro-averaged Precision, Recall, and F1 score can actually be identical to Accuracy. By understanding these metrics through practical formulas and examples, you’ll see why micro-averaged measures reflect the same value as Accuracy and how this insight can influence your model evaluation.
Micro-averaged precision, recall, and F1 score are metrics computed by aggregating the true positives, false positives, and false negatives across all classes before calculating precision, recall, and F1. This treats every individual prediction equally, which is why micro‑averaged metrics are often used when overall performance across all classes is more important than performance on each class separately.
Use micro‑averaged metrics when your dataset is imbalanced, and you care about the overall performance on all predictions, not the performance per class. Macro‑averaged metrics give each class equal weight, while micro‑averaged metrics give each prediction equal weight.
In multi‑class classification, when each sample belongs to exactly one class, and predictions are evaluated across all classes, the micro‑averaged precision, recall, F1 score, and accuracy can become mathematically equivalent because they are all based on the same aggregated counts of true positives, false positives, and false negatives. This post provides the step‑by‑step proof.







No comments yet. Be the first to share your thoughts!