Expected calibration error 2026-11-05
Expected calibration error summarizes how reported confidence differs from observed correctness. For top-label statistical classification, the population quantity compares correctness probability conditional on confidence with that confidence. A commonly reported finite-sample estimate groups predictions into confidence intervals and compares the mean confidence and accuracy in each interval.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §2, Eqs. (2)–(3), population calibration gap and binned estimate
For a nonempty bin among predictions, defineHere is confidence in the selected class, not its numerical label. The empirical statistic isEmpty bins have zero weight and need no undefined bin average. The cited paper uses equal-width bins.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §2, bin definitions and Eq. (3), printed pp.1322–1323
A synthetic example shows why the partition matters. Four predictions have confidences and correctness indicators . With one bin, accuracy and mean confidence are both , so the estimate is zero. With four equal-width bins on , only the last two are populated. Their accuracy/confidence pairs are and , each with half the observations. ThusThis is ten percentage points, despite unchanged predictions and labels.
A zero coarse-bin result can conceal opposing gaps; it does not establish perfect probability calibration or agreement within every subgroup. Report bin boundaries, sample size, confidence convention and scale. Reliability diagrams reveal where the gaps occur, while a scalar expected calibration error supplies their sample-weighted summary. It is distinct from the fraction of incorrect classifications.
Temperature scaling 2026-11-05
Temperature scaling is a method of probability calibration that divides a model's neural network logits by one fitted positive scalar before applying the softmax function. The temperature is selected after model training, using labels in a held-out validation set to minimize the negative log-likelihood. It adjusts reported probabilities without retraining all model weights.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §4.2, Eq. (9), scalar temperature and validation negative log likelihood
For class scores and ,For the synthetic two-class scores , the first-class probability isThe selected class remains the first while its reported confidence decreases.
The preservation of the selected class follows directly: dividing by positive preserves every score ordering and equality, and exponentiation is strictly increasing. Thus the set of classes attaining the largest score is unchanged. This concerns ordering between classes within one example; it does not assert preservation of confidence ordering between different examples.
A motivating measurement in the original study compares reliability diagrams for a 110-layer image-classification network. Its reported expected calibration error changes from before calibration to after temperature scaling. This is a result for that experimental setup and binned metric, not a guarantee for every classifier or input distribution.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §5 and Fig. 4, CIFAR-100 ResNet-110 before/after reliability diagrams
Use separate data for fitting the temperature and for final evaluation. One scalar can improve an overall confidence mismatch but cannot represent every class-specific or input-dependent error. The name refers to this probability transformation; no physical temperature is being measured.