How to use this calculator
Compare positive-class probabilities with observed event frequencies in equal-width bins.
- Enter Predicted positive probabilities, True binary outcomes, Equal-width bins. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Expected calibration error equal width bins explained
Measure the sample-weighted gap between mean predicted probability and observed binary frequency in equal-width bins.
How the calculation works
Σ bin frequency × |mean probability − observed rate|
Each bin contributes its share of the sample multiplied by the absolute difference between mean probability and observed outcome rate. This is binary positive-probability ECE, not top-label multiclass ECE.
Set up the calculation
p— Predicted positive probabilities- One model probability per case, each from 0 to 1, in the same order as the outcomes.
y— True binary outcomes- Observed labels for those cases: 1 for positive and 0 for negative, paired position by position.
k— Equal-width bins- Number of probability intervals spanning 0 to 1; the final bin includes probability 1.
Limits of this model
This is binary positive-probability ECE, not top-label multiclass ECE. Results depend strongly on binning and sample size.
Check this example
Predicted positive probabilities = 0.1, 0.3, 0.7, 0.9; True binary outcomes = 0, 0, 1, 1; Equal-width bins = 2.
- Equal-width expected calibration error: 0.2
Each bin has a 0.2 calibration gap and half the samples, so this equal-width binary ECE is 0.2. ECE depends on the chosen binning.
Interpreting the result
An ECE of 0.2 is a sample-weighted average gap of 0.2 probability points on this example’s 0–1 scale; it depends on the chosen bin boundaries and does not certify calibration for every subgroup.
Frequently asked questions
Do bins contain equal numbers of items?
No, they cover equal probability widths.
Where does probability one go?
Into the final bin.
Does low ECE prove calibration?
No, binning can conceal local errors.
How do I use the Expected calibration error equal width bins calculator?
Enter Predicted positive probabilities, True binary outcomes, Equal-width bins. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Expected calibration error equal width bins?
Predicted positive probabilities = 0.1, 0.3, 0.7, 0.9; True binary outcomes = 0, 0, 1, 1; Equal-width bins = 2. Equal-width expected calibration error: 0.2 Each bin has a 0.2 calibration gap and half the samples, so this equal-width binary ECE is 0.2. ECE depends on the chosen binning.
External model references: Guo et al. (2017), calibration and bin-based expected calibration error; Roelofs et al. (2022), binning-based calibration error estimation. These references support calibration and binning sensitivity; the page uses binary equal-width bins.
Read our calculation methodology.