Whether a model's confidence can be trusted. If it says 80%, is it actually right about 80% of the time?
| Full name | Expected Calibration Error |
| What it measures | Whether a model’s stated confidence matches its actual accuracy |
| Formula | Bucket predictions by confidence, then take the weighted average gap between confidence and accuracy in each bucket |
| Typical range | 0 (perfectly calibrated) upward. Often reported as a percentage |
| Used for | Any model whose confidence score feeds a downstream decision |
| Best used for | Risk-sensitive systems: medical triage, autonomous driving, fraud review, anywhere a human trusts the number |
| Pair with | Accuracy or AUC, since a model can rank well while still being badly calibrated |
A model that is right 70% of the time it says “90% confident” is not a slightly-off model. It is a model whose confidence number cannot be trusted at all, and any system built on the assumption that it can will make systematically bad decisions. ECE measures exactly this gap between stated confidence and actual correctness.
Group every prediction into bins by its confidence score, typically ten bins from 0 to 100%. Within each bin, compare the average confidence the model reported to the actual fraction of predictions in that bin that were correct. ECE is the weighted average of the gap between those two numbers across all the bins, weighted by how many predictions fell into each one.
Take a model’s predictions that fall into the “90 to 100% confident” bin, 100 of them in total, with an average stated confidence of 95%. If only 75 of those 100 predictions turn out to be correct, the actual accuracy in that bin is 75%, against a claimed confidence of 95%, a 20-point gap. If that bin holds 10% of all predictions, it contributes 0.10 × 0.20 = 0.02 to the overall ECE. Sum that contribution across every bin and you have the final score. Deep neural networks are a frequent source of exactly this problem: Guo and colleagues showed in 2017 that modern networks, despite being far more accurate than older ones, had become substantially more overconfident, a finding that made calibration a standard check for any deployed classifier.
Calibration matters wherever a human, or another system, acts on the confidence number rather than just the top prediction. A doctor deciding whether to order more tests based on a model’s risk score, an autonomous vehicle deciding how much to trust its object detector in fog, a fraud system deciding whether 85% confidence is high enough to freeze an account automatically: all of these treat the number as meaningful, and ECE tells you whether that trust is earned.
ECE catches a failure mode that accuracy and AUC cannot see at all, since both of those only care about the ranking or the top prediction, never the stated probability itself. It is intuitive to explain to a non-technical audience: does 80% confident mean right 80% of the time? And it can be measured on any model that outputs a probability, with no extra labelling required beyond what accuracy already needs.
The binning choice matters more than people expect. Too few bins hide real miscalibration by averaging it away; too many bins make the estimate noisy, especially in bins with few examples. ECE also reports one aggregate number across the whole confidence range, which can hide a model that is well calibrated in the middle of the range but badly overconfident exactly where it matters most, at the very top. And it says nothing about accuracy or ranking at all: a model can be perfectly calibrated while being nearly useless, for instance by learning that its true accuracy is 50% and honestly reporting 50% confidence on every single prediction.
I check calibration on any model whose output confidence will be shown to a user or fed into another automated decision, which in practice is most deployed classifiers. I always report it alongside accuracy or AUC, never alone, because a model needs both qualities: good rankings and honest confidence. If ECE reveals overconfidence, post-hoc fixes like temperature scaling or Platt scaling are cheap to apply and worth trying before retraining anything.