Reliability Diagram
A reliability diagram visualizes calibration by comparing predicted confidence with empirical accuracy in bins.
Partition predictions into confidence bins . For bin :
A calibrated model has:
for every bin with enough examples.
Expected Calibration Error
Expected calibration error summarizes the bin gaps:
Confidence Definition
For multiclass classification, confidence is often:
and correctness is:
For binary classification, confidence can mean or . State which one is used.
For regression, ranking, generation, or structured prediction, a reliability diagram needs a task-specific confidence event such as interval coverage, selective accuracy, or validity probability.
Bin Design
| Choice | Risk |
|---|---|
| equal-width bins | high-confidence bins may have few examples |
| equal-count bins | bin boundaries differ across models |
| too many bins | noisy calibration estimates |
| too few bins | hides local miscalibration |
| test-set tuning | overstates calibration quality |
Calibration estimates should include uncertainty when the bin counts are small:
where .
Reading the Plot
| Pattern | Interpretation |
|---|---|
| accuracy below confidence | overconfident predictions |
| accuracy above confidence | underconfident predictions |
| low-confidence bins sparse | uncertainty claim is weak in that range |
| high-confidence gap | risky for automated decision or filtering |
Calibration does not replace accuracy. A model can be well-calibrated and still wrong often, or accurate but overconfident.
Checks
- Are bins populated enough to be meaningful?
- Is calibration measured on held-out data?
- Is confidence defined consistently for binary, multiclass, or structured output?
- Does calibration hold under distribution shift?
- Are accuracy and calibration both reported?
- Are binning choices fixed before comparing models?