Smooth ECE: Principled Reliability Diagrams via Kernel Smoothing

Jaroslaw Blasiok, Preetum Nakkiran
9/1/2023
91 citations

Official code: apple/ml-calibration (191 stars, Jupyter Notebook, last commit 2025-11-04).

Abstract

Calibration measures and reliability diagrams are two fundamental tools for measuring and interpreting the calibration of probabilistic predictors. Calibration measures quantify the degree of miscalibration, and reliability diagrams visualize the structure of this miscalibration.

Show full abstract

However, the most common constructions of reliability diagrams and calibration measures -- binning and ECE -- both suffer from well-known flaws (e.g. discontinuity). We show that a simple modification fixes both constructions: first smooth the observations using an RBF kernel, then compute the Expected Calibration Error (ECE) of this smoothed function. We prove that with a careful choice of bandwidth, this method yields a calibration measure that is well-behaved in the sense of (B{\l}asiok, Gopalan, Hu, and Nakkiran 2023a) -- a consistent calibration measure. We call this measure the SmoothECE. Moreover, the reliability diagram obtained from this smoothed function visually encodes the SmoothECE, just as binned reliability diagrams encode the BinnedECE. We also provide a Python package with simple, hyperparameter-free methods for measuring and plotting calibration: `pip install relplot\`.

View on arXivView PDF

Code Implementations(1)

relplot: Utilities for measuring calibration and plotting reliability diagrams

19111Jupyter Notebook, PythonJun 29, 20231 years agoNOASSERTION

Similar Papers

Cite this paper

@article{blasiok2023smooth,
  title  = {Smooth ECE: Principled Reliability Diagrams via Kernel Smoothing},
  author = {Jaroslaw Blasiok and Preetum Nakkiran},
  year   = {2023},
  eprint = {2309.12236},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.12236},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.12236.svg)](https://codeofpaper.com/paper/2309.12236)

Discussion