Never mind the metrics - what about the uncertainty? Visualising binary confusion matrix metric distributions to put performance in perspective

David R. Lovell, Dimity Miller, Jaiden Capra, Andrew P. BradleyICML 2023

Machine learning performance metrics like the F1-score and Matthews Correlation Coefficient (MCC) are often treated as absolute truths. However, they are actually noisy estimates derived from finite data. This paper introduces the "Confusion Simplex"—a 3D visualization framework—and Bayesian modeling to demonstrate how statistical uncertainty can easily eclipse the tiny performance gains celebrated on modern leaderboards.

The Problem with "Leaderboard Culture"

In today’s machine learning landscape, researchers and engineers frequently engage in "performance shoot-outs." A model is often crowned "state-of-the-art" based on a marginal improvement in a numerical metric (e.g., achieving an MCC of 0.82 versus a competitor's 0.81).

The authors argue that this narrow focus ignores a fundamental reality: performance metrics are calculated from confusion matrices, which are collections of discrete counts (True Positives, False Negatives, etc.). Because these counts are based on finite test sets, they are subject to significant sampling uncertainty. If you were to evaluate the exact same model on a slightly different test set, the metric might swing wildly. The paper tackles the lack of tools for visualizing this uncertainty and challenges the field's tendency to treat discrete, noisy counts as precise, continuous performance indicators.

Visualizing Classifier Performance

To combat the illusion of precision, the paper introduces several novel ways to think about and visualize classifier performance:

1. The Confusion Simplex

The authors propose an isometric 3D projection that maps confusion matrices (which have three degrees of freedom for a fixed sample size $N$) into a tetrahedral space.

The Confusion Simplex mapping confusion matrices into a 3D tetrahedral space.

This "Confusion Simplex" allows us to see how every possible confusion matrix relates to others, providing a geometric intuition for how metrics behave across all possible classification outcomes.

2. Metric Contours

By deriving exact algebraic expressions for the "isolines" (contours) of various metrics within Receiver Operating Characteristic (ROC) space, the authors reveal the hidden "geometry" of metrics. For example, MCC forms concentric ellipses, while the F1-score forms straight lines that intersect at a specific point outside the standard ROC square.

3. Bayesian Uncertainty Modeling

Instead of calculating a single point-estimate metric, the authors use Binomial and Beta-Binomial models to produce a Probability Mass Function (PMF) for the metric. This approach visualizes the full range of likely performance values given the observed data, rather than a single misleading number.

Key Insights and Results

By applying these visualization techniques to both synthetic data and real-world datasets (such as a Cocaine Purity dataset), several critical insights emerge:

  • Uncertainty Eclipses Difference: In many benchmark scenarios, the "spread" of a metric's distribution is much larger than the difference between two competing models. A model deemed "better" on a leaderboard might simply be "luckier" on that specific test set.
  • The $1/\sqrt{N}$ Rule: To halve the uncertainty (standard deviation) of your performance estimate, you must quadruple your test data. This highlights the extreme difficulty of making high-precision performance claims using small benchmark datasets.
  • Discrete Jumps: Because confusion matrices are constructed from integer counts, metrics are not truly continuous. For small datasets, the PMF of a metric like the F1-score can look "spiky" or "lumpy" because only certain fractional values are mathematically possible.
Probability Mass Functions (PMFs) demonstrating the discrete, spread-out nature of metrics like MCC, Balanced Accuracy, and F1.
  • The Reality of Class Imbalance: The authors argue that class imbalance is problematic not just because of the ratio of classes, but because it often implies a very small absolute number of samples in the minority class. This absolute scarcity is the primary driver of metric uncertainty.

Ultimately, the authors show that different metrics "fail" in different ways. For instance, F1-score contours are highly sensitive to prevalence, meaning a model's F1-score can change drastically if the class balance in production differs even slightly from the test set.

Limitations and the Path Forward

While the visualizations provided are powerful, the current framework is optimized primarily for binary classification. Expanding this to visualize a $C \times C$ multi-class confusion matrix in 3D remains a complex challenge, though a "one-versus-all" approach is suggested.

Furthermore, these models assume the test data is a perfectly representative sample of the production environment. If "dataset shift" occurs, the real-world uncertainty is even higher than what is modeled here.

The authors acknowledge that moving the AI community away from single-number summaries toward distributional reporting (like box plots or violin plots for metrics) requires a significant cultural shift. However, embracing this uncertainty is a necessary step toward building more robust, trustworthy machine learning systems.

Summary updated

BibTeX
@inproceedings{lovell2023never,
  author = {David R. Lovell and Dimity Miller and Jaiden Capra and Andrew P. Bradley},
  title = {{Never mind the metrics - what about the uncertainty? Visualising binary confusion matrix metric distributions to put performance in perspective}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=AX8c84pPBiq},
}
Figure