Reliability diagram

Also known as: calibration curve · calibration plot

On this page 7

A reliability diagram is a plot that compares a model’s predicted probabilities with the observed frequency of the predicted outcome, grouped into confidence bins, to show how well the model is calibrated. In model evaluation, it is the standard visual tool for answering a simple question: when a classifier says it is 70 percent confident, is it right about 70 percent of the time?

The diagram is also called a calibration curve or calibration plot. It originated in weather forecasting, where meteorologists checked whether a forecast of a 30 percent chance of rain was followed by rain on roughly 30 percent of such days, and it is now used throughout artificial intelligence to evaluate classifiers, risk models and language models whose scores feed into decisions.

How a reliability diagram is constructed

A reliability diagram is built by sorting predictions into bins by confidence and comparing, in each bin, the average predicted probability with the actual fraction of positive outcomes. The horizontal axis shows mean predicted probability, the vertical axis shows observed frequency, and a diagonal line from the origin to the upper right marks perfect calibration.

For binary classification, the procedure uses the probability of the positive class. For multiclass models, the common variant uses the top-label confidence, the highest predicted class probability, and plots it against accuracy within each bin. Most diagrams also include a histogram of bin counts below the curve, because a bin with very few samples gives an unreliable point.

The table summarizes the construction steps and the choices that most affect the result.

StepWhat is doneKey choice
Collect scoresRun the model on held-out dataUse a test set, never training data
Bin predictionsGroup scores into confidence intervalsNumber and type of bins
Compute bin statisticsMean confidence and observed frequencyPositive rate or accuracy
Plot pointsPlace each bin against the diagonalShow bin counts or error bars
SummarizeCompute a scalar calibration metricECE, MCE or Brier score
Steps in building a reliability diagram

Reading the shape of the curve

The position of the curve relative to the diagonal reveals the direction of miscalibration. Points below the diagonal mean the model is overconfident: its predicted probabilities are higher than the rate at which it is actually correct. Points above the diagonal mean the model is underconfident, which is less common in modern deep networks but frequent after heavy regularization or ensembling.

Characteristic shapes point to specific causes and fixes, as the table shows.

Curve patternInterpretationTypical cause
Close to diagonalWell calibratedSuitable loss and data
Below diagonal at high confidenceOverconfident predictionsLarge networks trained to low loss
Above diagonal throughoutUnderconfident predictionsStrong label smoothing or ensembling
S-shaped curveScores too extreme at both endsMargin-based models such as SVMs
Inverted S-shapeScores pulled toward the middleNaive averaging or boosted trees
Erratic pointsInsufficient samples per binSmall evaluation set
Common reliability diagram patterns

A well-known finding in deep learning is that modern neural networks tend to be overconfident, so their reliability diagrams often sag below the diagonal in the high-confidence region even when accuracy is excellent.

The appearance of a reliability diagram depends heavily on how predictions are binned. Equal-width binning uses fixed intervals, typically 10 or 15 bins of width 0.1 or about 0.067, but many bins may end up nearly empty. Equal-mass binning, also called adaptive or quantile binning, places the same number of samples in each bin, which gives more stable estimates at the cost of uneven bin widths.

Scalar metrics condense the diagram into a single number, which is useful for comparing models but hides where the error occurs. The table compares the most frequently reported measures.

MetricDefinitionStrengthWeakness
Expected calibration errorWeighted mean gap between confidence and accuracyEasy to interpretSensitive to bin count
Maximum calibration errorLargest gap across binsHighlights worst caseUnstable on sparse bins
Brier scoreMean squared error of probabilitiesNo binning neededMixes calibration and sharpness
Log lossNegative log likelihood of outcomesStrictly proper scoring ruleDominated by extreme errors
Metrics derived from or related to the reliability diagram

The Brier score can be decomposed into reliability, resolution and uncertainty components, and the reliability term is exactly what the diagram visualizes. Reporting the diagram alongside a proper scoring rule gives the most complete picture.

Using reliability diagrams to fix calibration

Reliability diagrams are most useful before and after post-hoc calibration, because they show whether a correction method actually moved the curve toward the diagonal. Calibration methods are fitted on a separate validation set and then evaluated on the test set to avoid optimistic results.

MethodHow it worksBest suited for
Temperature scalingDivides logits by one learned constantOverconfident neural networks
Platt scalingFits a logistic function to scoresSVMs and small datasets
Isotonic regressionFits a monotonic step functionLarge validation sets, complex distortions
Histogram binningReplaces scores with bin frequenciesSimple, interpretable correction
Calibration methods and when to use them

Temperature scaling is the usual first choice for deep classifiers because it does not change accuracy: it rescales confidence without altering the ranking of classes.

Limitations and common mistakes

A reliability diagram shows average calibration within bins, not calibration for every individual prediction or subgroup. A model can look well calibrated overall while being badly miscalibrated for a minority group or under distribution shift, so careful teams draw separate diagrams per segment and per deployment period.

  • Plotting training data instead of held-out data makes almost any model look overconfident or deceptively accurate.
  • Ignoring bin counts leads to overinterpreting points based on a handful of samples.
  • Confusing calibration with accuracy: a model that always predicts the base rate is perfectly calibrated yet useless.
  • Comparing ECE values computed with different binning schemes produces misleading rankings.

In everyday language

Many AI models say how sure they are. A reliability diagram checks whether that confidence is honest.

Picture a weather presenter who says there is a 70 percent chance of rain on many days. If it rains on about 7 of every 10 such days, the presenter is trustworthy. If it rains on only 4 of them, the forecasts sound more certain than they should. The diagram draws this check as a simple chart. A line that follows the diagonal means the model knows how much it knows.

Seen in the real world

A hospital analytics team builds a model that predicts the risk of patient readmission within 30 days. Clinicians plan to call every patient whose predicted risk exceeds 20 percent, so the scores must mean what they say, not only rank patients correctly.

On a held-out set of 12,000 discharges, the model reaches a strong AUC, but the reliability diagram drawn with 10 equal-mass bins shows the top bins well below the diagonal: patients scored at 40 percent were readmitted only about 25 percent of the time. The team fits isotonic regression on a separate validation set and redraws the diagram.

After calibration, the curve follows the diagonal closely, the expected calibration error drops substantially, and the follow-up program contacts fewer low-risk patients while keeping nearly all high-risk ones on the call list.