Manuscript Offprint

arXiv:2611.08048

Performance metrics in machine learning: a scenario-based guide from the confusion matrix to calibration, regression and uncertainty

Mehmet Baygin, Sengul Dogan, Turker Tuncer

Abstract

Background and purpose: Machine-learning and deep-learning studies are compared through performance metrics. The same predictions can yield very different numbers depending on the metric, the class mix, the decision threshold, the averaging rule, the evaluation unit and the software convention. This methodological tutorial explains these mechanisms with controlled scenarios whose inputs every reader can recompute.

Materials and methods: Twenty-two confusion-matrix metrics were organized in a prevalence-coded metric map. Fifteen controlled scenarios (S1–S15) covered binary and multi-class classification, ranking and probability quality, regression, interval estimation, aggregation, reverse calculation and software conventions. Every scenario fixed its inputs in released files and changed one factor at a time. All values were recomputed with independent library functions (scikit-learn, statsmodels, SciPy and mlscorecheck) or independent re-implementations.

Results: All 205 verification checks passed, 202 of them independent and 3 internal. An always-negative rule reached an accuracy of 0.990 at a prevalence of 0.010, with a balanced accuracy of 0.500. At fixed sensitivity and specificity, precision fell from 0.889 to 0.008 as prevalence fell from 0.5 to 0.001. Three probability variants shared a ROC-AUC of 0.825, but their calibration slopes were 2.08, 1.04 and 0.52. With 10 participants, a participant-majority accuracy of 0.700 had a 95% interval of 0.348–0.933. Fold-averaged scores were flagged as inconsistent only when they were tested as one pooled test set.

Conclusions: The scenarios isolate mechanisms; they do not estimate how often each mechanism occurs in published studies. A literature audit and a real-data demonstration are specified as protocols in an appendix and were not executed. The released inputs, scripts, goal-based metric table and reporting checklist support transparent metric choice and reporting.

Keywords: performance metrics; confusion matrix; class imbalance; Matthews correlation coefficient; calibration; precision-recall curve; regression error; confidence intervals; reporting guidelines

1. Introduction

Machine-learning and deep-learning studies are ranked by numbers. A reported accuracy, F1 score or area under the curve is read as a property of the model. It is, however, also a property of the test set, the decision threshold, the averaging rule, the evaluation unit and the software that computed it. The same predictions can therefore support very different summaries. On a test set with 1% positive cases, a rule that never predicts the positive class reaches an accuracy of 0.990 and a balanced accuracy of only 0.500.

The data behind a performance estimate are determined by the evaluation design. Leakage between training and test sets can inflate performance. The same risk arises if segment-level and participant-level estimates are combined [1, 2]. These design issues are outside this guide's scope. The design is held fixed here. Metric interpretation and reporting are examined for a fixed set of predictions.

Complete metric reports are required by guidance for prediction models and image analysis [3, 4]. Yet the reasons behind these recommendations are not always clear. Accuracy is widely accepted as misleading under imbalance. The size of this effect depends on numerical inputs. These are rarely provided, so readers often cannot repeat the calculation.

This study is a methodological tutorial on performance metrics with released and independently verified inputs. Constructed scenarios are presented; an empirical literature survey was not performed. A prevalence-coded map is used to organize 22 confusion-matrix metrics. One mechanism is examined in each of 15 controlled scenarios. Classification, probability quality, regression and reporting are covered. All values are recomputed with independent software. Internal re-derivations are counted separately. Reported values can be screened with a consistency framework that separates inconsistent reports from reports that cannot be assessed. All proportions are reported on the 0–1 scale.

References (44)