Paper commentary
Metrics for Multi-Class Classification: an Overview
Accuracy can hide weak small classes in multi-class classifiers
- Problem Accuracy is a popular single score for multi-class classifiers, but it hides errors on small classes because every sample counts equally.
- Method The authors review confusion-matrix metrics and state what each one reveals about a classifier's errors.
- Results On an imbalanced example, Accuracy is 0.689 while Balanced Accuracy is 0.615.
Why one number can mislead
A multi-class classifier assigns each sample to one of K classes, and a team usually wants a single number to compare models. That number becomes misleading when class sizes differ, because a popular metric counts every sample equally. Large classes then dominate the score, and a weak small class can disappear inside it.
So the real question is which metric exposes which kind of error, and at what cost. All the metrics reviewed start from the confusion matrix, since it records how predictions relate to the true labels.
Reading the confusion matrix
Rows hold the true classes and columns hold the predicted ones, so each cell counts samples with one true label and one predicted label. Correct predictions fall on the diagonal, so each diagonal cell counts agreement between the two. Precision for one class divides its true positives by the whole predicted column, which is everything the model labelled as that class.
Recall divides the same true positives by the whole true row, which is everything that actually belongs to that class.
Written out, \(\text{Precision} = \frac{TP}{TP+FP}\) and \(\text{Recall} = \frac{TP}{TP+FN}\). Precision tells how far the model's positive calls can be trusted, while Recall tells how many true positives it finds. These two quantities are the building blocks for both Balanced Accuracy and F1-Score.
Accuracy and Balanced Accuracy on imbalanced data
Accuracy divides the correct predictions, the diagonal, by all entries of the matrix. Each sample carries the same weight, so a class with many samples decides most of the result. Balanced Accuracy instead averages the recall of each class, so every class counts once whatever its size. On a roughly balanced dataset the two scores nearly coincide, and they diverge only when class sizes are uneven.
On the Figure 3 dataset, Accuracy is 0.689 while Balanced Accuracy is 0.615. The gap comes from recall weighting, and class a shows it best: 57 of its 62 samples went to other classes. Its recall of 0.0806 pulls Balanced Accuracy down, but Accuracy barely moves because class a is small. The authors present this as a perk when rare classes matter and as a drawback when the whole dataset matters.
Weighting recalls by class frequency
Balanced Accuracy Weighted multiplies each class recall by that class's weight \(w_k\), its frequency in the whole dataset. The weighted recalls are summed over the K classes and divided by K times \(W\), the total of the weights. Large classes keep a weight close to their share of the data, while small classes count for less.
Each class recall stays separate inside the sum, so the score still shows which class performs poorly. The authors suggest it as a performance indicator when training a classifier over a wide number of classes. They interpret the value as the probability of correctly predicting a given unit, although the formula differs from Accuracy.
F1-Score across many classes
F1-Score combines Precision and Recall through a harmonic mean, which is 1 at its best and 0 at its worst. The harmonic mean is pulled toward the smaller of the two values, so a weak Precision or Recall drags the score down hard. Model A has precision and recall both at 80%, and its F1-Score is 80%. Model B has 60% precision and 100% recall, so its arithmetic mean is also 80%, yet its F1-Score falls to 75%.
On the binary matrix of Figure 2, precision of 0.66 and recall of 0.80 give an F1-Score of 0.72.
For K classes the authors compute precision and recall per class, treating one class as positive at a time. Macro-averaging takes the plain mean of the per-class values, so every class carries the same weight. Macro F1-Score is the harmonic mean of Macro-Precision and Macro-Recall, and it reads as a class-level view. Micro-averaging pools all samples, so Micro-Precision and Micro-Recall both reduce to the true positives over the grand total.
Micro F1-Score therefore equals Accuracy, and the authors read this as a new interpretation of Accuracy.
Cross-Entropy scores the probabilities
Cross-Entropy compares the true class distribution with the predicted one, and small values mean the two are close. For one sample the true label is a one-hot vector, so only the true class's predicted probability survives in the sum. Averaging over the N samples gives the dataset value.
Cross-Entropy doesn't use the confusion matrix, so it doesn't judge the rule that turns probabilities into labels. It is fast to compute, but it reads only the probability of the true class and ignores how the rest is spread. In the authors' example, two algorithms both give 0.4 to class 2, the true label, so they receive the same score. Yet one of them ranks class 2 first and the other ranks class 6 first, and only the first gets the unit right.
MCC across the whole matrix
MCC treats the predicted and true labels as two random variables and measures how strongly they move together, from -1 to +1. In the binary case the numerator is TP times TN minus FP times FN, and the denominator is a square root of the four row and column totals. For K classes the authors use c, the number of correct predictions, s, the total number of samples, and the predicted and true totals per class.
The denominator rescales the result, since it sets the largest absolute value the numerator can take.
The lower bound of MCC isn't fixed, and it shifts with the number and the actual distribution of classes. In the total unbalanced example of Figure 9, every sample goes to one class, MCC falls to 0 and Accuracy stays at 0.80. So a high Accuracy can coexist with no correlation between predictions and labels. The authors add that unbalanced predictions make MCC swing widely during training.
Cohen’s Kappa corrects for chance
Cohen’s Kappa treats predictions and true labels as two categorical variables and asks how far their agreement exceeds chance. It is \(K = \frac{P_o - P_e}{1 - P_e}\), where \(P_o\) is the observed agreement, which is the Accuracy, and \(P_e\) is the Expected Accuracy. \(P_e\) is built from the marginal totals, the chance that a sample is predicted positive times the chance it is truly positive, plus the same for negative.
Subtracting \(P_e\) removes the agreement a random classifier with the same marginals would reach.
The authors read Kappa as a measure of how much predictions depend on the true labels. For multi-class cases the numerator matches MCC and the denominator is a little lower, so Kappa scores come out slightly higher. Because the chance term absorbs each dataset's structure, two models on different datasets can be compared.
What the examples leave open
The numerical support is a few small hand-built matrices: the four-class Figure 3 dataset, the Figure 2 binary matrix and the Figure 9 matrix. The text reports no benchmark run on trained classifiers, so the examples show how the metrics respond, not how models rank. The authors also call the Kappa interpretation bands somewhat arbitrary.
Whether these metric behaviours hold on real multi-class datasets with real models was not tested. The paper frames its contribution as guidance on advantages, disadvantages and usage, not as a ranking of metrics.
Paper info
- Authors
- Margherita Grandini, Enrico Bagli, Giorgio Visani
- Venue
- arXiv · Preprint
- First published
- 2020-8-13
- Added
- 2026-11-12
- Updated
- 2020-8-13
- Version
- v1
- arXiv
- 2008.05756
- Category
- stat.ML · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Margherita Grandini, Enrico Bagli, Giorgio Visani (2020). Metrics for Multi-Class Classification: an Overview. arXiv:2008.05756v1. https://arxiv.org/abs/2008.05756v1
BibTeX
@misc{grandini2020metrics,
title = {{Metrics for Multi-Class Classification: an Overview}},
author = {Margherita Grandini and Enrico Bagli and Giorgio Visani},
year = {2020},
eprint = {2008.05756},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2008.05756v1}
}