Calibration in Machine Learning: Validating Probabilities

Calibration in machine learning is not accuracy: how to measure it on holdout data, size the sample, recalibrate, verify independently and monitor it.

Calibration in Machine Learning: Validating Probabilities
Written by TechnoLynx Published on 01 Nov 2026

Calibration in machine learning means a model’s predicted probabilities match the observed frequencies of the outcomes. Take every case a well-calibrated binary classifier scores at about 0.8: roughly 80% of them should turn out positive. A model can achieve high accuracy yet be poorly calibrated. The gap matters when someone acts on the probability itself. For a clinician, a well-calibrated predicted complication risk of 18% carries information that a binary prediction does not.

The route that holds up runs in order. Measure calibration on held-out data with a reliability diagram, a summary statistic and a proper scoring rule. Size the holdout so the estimate means something. Recalibrate only when the diagnostic calls for it, then verify the result again. Fix the acceptance standard before anyone looks at results, have someone outside the build team reproduce the numbers, and automate the check so it reruns after every model update.

Can a model be accurate and still badly calibrated?

Yes. Niculescu-Mizil and Caruana (2005) argued that good accuracy or a good area under the ROC curve is not enough in applications that need well-calibrated probabilities. High accuracy and good calibration do not automatically go together. In one comparison, two models were both well calibrated, but one had much lower accuracy than the other. Guo et al. (2017) found that modern neural networks, unlike those from a decade earlier, are poorly calibrated.

A perfect calibration metric does not rule out a model with low accuracy. The authors of the Calibrate tool show a model whose expected calibration error is 0 despite a high error rate, and argue that a reliability diagram reveals what ECE alone would not. A reassessment of calibration metrics made a related point with a recalibration that always predicts the mean confidence from a calibration set. That recalibration minimises calibration error without changing a single prediction, so reporting calibration error and accuracy together cannot detect it. Negative log-likelihood or mean squared error detected it immediately.

Worked example: an ECE of zero with no skill

Assume a binary outcome with a 30% base rate, and a model that outputs 0.3 for every case.

  • Expected calibration error. All predictions fall into one bin. Mean confidence is 0.3 and the observed rate is 0.3, so ECE is 0.
  • Brier score (binary form). Positives contribute (0.3 − 1)² = 0.49 and negatives (0.3 − 0)² = 0.09. The mean is 0.3 × 0.49 + 0.7 × 0.09 = 0.21, which is the same as a forecast that knows nothing beyond the base rate.
  • Accuracy at a 0.5 threshold. The model predicts negative every time and scores 70%, exactly the majority-class rate.
  • Discrimination. Every score is identical, so the model cannot rank cases at all.

An ECE of zero does not rule out a model with low accuracy, so report a proper scoring rule alongside ECE.

Measuring calibration in machine learning on holdout data

Report calibration error alongside the appropriate generalisation metric, with a calibration visualisation that shows the density of predicted confidences. Out-of-sample calibration should be assessed on a test set that played no part in training or model selection.

Which calibration diagnostic fits which situation

Diagnostic What it tells you Where it misleads When to use it
Reliability diagram (calibration curve) Observed fraction of positives against mean predicted probability, bin by bin Bin count and binning strategy can change its appearance drastically Alongside a histogram of predictions
Calibration intercept and slope The intercept shows systematic over- or under-estimation; perfect calibration is intercept 0.0 and slope 1.0 Report it with a calibration plot Binary prediction models, where intercept and slope are part of the reporting minimum
Expected calibration error (ECE) Mean absolute gap between predicted confidence and observed accuracy Prone to estimator bias, and can be 0 for a model with low accuracy Alongside a proper scoring rule such as NLL or MSE
Brier score or log loss Proper scoring rules, minimised when predictions equal the true class distribution One number; the CORP decomposition separates miscalibration from discrimination Always, alongside ECE
Hosmer-Lemeshow test A goodness-of-fit test for logistic model calibration Becomes too powerful as the number of observations grows Read with sample size, per-decile observed and predicted probabilities, and other calibration measures
Calibration belt Shows the probability ranges where the model is poorly calibrated With large samples it will usually reject good calibration Large samples, where the graph shows how far off the model is

How do you read a calibration plot, and what does overconfidence look like?

A well-calibrated model’s reliability diagram follows the diagonal y = x, because its predictions match the true class rate. Points below the diagonal mean overconfidence: the model predicts a higher probability than the true occurrence rate. Points above it mean underconfidence. A poorly calibrated model departs from the diagonal in some consistent way or has an erratic shape. Long horizontal stretches in an isotonic (CORP) reliability diagram indicate diminished discrimination ability. A practical guide for clinicians suggests ten equal-sized groups for a large cohort and five for a small one to smooth the curve.

A large bin count creates many small, high-variance bins, and a small bin count washes out local calibration information. In one example, moving from eight to ten bins produced a large difference in the conclusion one might draw about the same random forest’s calibration. The CORP authors showed 9, 10 and 11 equidistant bins producing drastically different diagrams for the same forecasts. Overconfident and underconfident predictions inside one bin can also cancel out, so the bin shows no error while substantial miscalibration sits inside it. Two diagrams can look identical yet have very different calibration errors when most predictions fall into a few bins. That is why a histogram or density of predicted probabilities belongs under every curve: being perfectly calibrated in a region where the model rarely predicts is worth little.

Some alternatives reduce the arbitrariness. CORP uses isotonic regression via the pool-adjacent-violators algorithm and chooses bins automatically, with no tuning parameters. Learned reliability diagrams fit a continuous function from predicted probability to outcome instead of binning. Bröcker and Smith (2007) added resampled consistency bars, which show how likely the observed frequencies are if the forecasts really were reliable. Nixon et al. (2019) recommend adaptive binning because it keeps metric rankings more stable as the bin count varies. The safer habit is to print the count on every bin and check that the conclusion survives a second bin count before reporting it.

How much holdout data before a per-bin calibration estimate can be trusted?

The precision wanted on the calibration slope often dictates the required sample size. Riley et al. (BMJ, 2024) report rules of thumb of at least 100 events and 100 non-events to estimate calibration measures, and at least 200 events and 200 non-events to derive calibration curves. They also warn that these rules are not specific to the model or setting, because precision depends on factors such as the distribution of predicted values. Their tailored worked example needed at least 949 participants (408 events) to estimate all four performance measures precisely, and calibration slope was the binding criterion. The target confidence interval width for the slope in that example was 0.3.

A Bayesian sample-size study’s final sample size of 1,181 was dictated by the assurance component for calibration slope. Dropping that criterion gave 522, and calibration errors stayed mostly below 0.1 except at extreme predicted risks. The desired precision on the slope is hard to justify but often dictates the final sample size, so plotting the likely variability of the calibration curve at a candidate size is the recommended check. Van Calster et al. (2016) found that flexible calibration assessment in small validation sets is problematic.

Small bins and deciles carry their own uncertainty. Bins with few observations have wider confidence intervals for their observed rate. Hosmer, Lemeshow and Sturdivant (2013), as summarised in a comparison of group counts, report that the test works best with at least five observations per group and six or more groups. For samples up to 1,000, ten groups is the recommendation.

Large samples bring the opposite problem for the Hosmer-Lemeshow test. Kramer and Zimmerman (2007) set observed mortality just 0.4% away from predicted mortality. The Hosmer-Lemeshow test was then significant at p < .05 in 10% of runs at 5,000 patients, 34% at 10,000 and 100% at 50,000. They concluded that a significant result does not by itself make a model suspect, and that the observed and predicted probabilities within each decile must also be considered. A modified large-sample test asks whether the fit is acceptable rather than perfect, with a default tolerance tied to a borderline result in a million observations.

Platt scaling or isotonic regression, and how do you check recalibration helped?

Platt scaling and isotonic regression are the two most commonly used calibration methods. The choice depends on the size of the calibration set. Both are fit on data independent of the classifier’s training data, because training-set outputs would bias the calibrator towards probabilities closer to 0 and 1 than they should be, a point Niculescu-Mizil and Caruana made for both methods.

Platt scaling works best when the distortion is sigmoid-shaped. Isotonic regression can correct any monotonic distortion, but it overfits more readily when data is scarce. Below about 200 to 1,000 calibration cases, Platt scaling outperformed isotonic regression with all nine learning methods tested. With 1,000 or more, isotonic regression was always as good or better. The scikit-learn documentation says the same: isotonic calibration is not recommended when calibration samples number well under 1,000, and sigmoid may be preferred for very uncalibrated classifiers on very imbalanced data because of its extra intercept. For neural networks, temperature scaling (a single-parameter variant of Platt scaling) was surprisingly effective on most datasets in Guo et al. (2017).

In scikit-learn, CalibratedClassifierCV offers sigmoid, isotonic and temperature methods. It uses cross-validation so the calibrator is always fit on unbiased predictions. Wrapping an already fitted model in FrozenEstimator uses all the supplied data for calibration, so keeping fitting and calibration data disjoint becomes the user’s job.

If the deformation of the calibration curve is not consistent across resamples or validation cohorts, recalibration is not recommended. When a model is recalibrated for an external population, both recalibrated and uncalibrated performance should be reported, because the uncalibrated figure is the only unbiased measure of generalisability.

A fix is not proven until it has been checked again:

  • Kumar, Liang and Ma (2019) found that Platt and temperature scaling are less calibrated than reported, and that current techniques cannot estimate how miscalibrated they are.
  • A benchmark across 117,702 neural networks in the NATS-Bench search space found nearly zero correlation between ECE before and after temperature scaling.
  • Nixon et al. (2019) found that the rank ordering of recalibration methods changes drastically with the choice of calibration measure.

So the recalibrated model gets the full diagnostic again on a split neither the model nor the calibrator touched. That means the diagram with its density plot, and the calibration error reported alongside accuracy and the appropriate generalisation metric.

Why should calibration be checked by someone outside the model-build team?

The person who chose the bins, the holdout, the calibrator and the metric can move the result with each of those choices without meaning to, so the person signing off should not be the person who made them. US banking supervisory guidance makes the same point. SR 11-7 (Federal Reserve, 2011) states that validation is generally done by staff who are not responsible for development or use and have no stake in the outcome, and that validation work done by developers must be critically reviewed by an independent party. SR 26-2 (Federal Reserve, OCC and FDIC, April 2026) describes effective challenge as needing appropriate expertise, enough independence to stay objective, and the standing to effect change. It also names misaligned incentives between development and validation reporting lines as a conflict of interest to manage. In healthcare, Feng et al. (2022) argue that monitoring should be done by an independent entity, even when the vendor designs the pipeline.

The independent party can be internal staff outside development and use, or an outside party. What matters is that they have no reporting line to the builders and their own access to the evidence. They need:

  • holdout data the build team neither assembled nor tuned on
  • the raw model scores from before any recalibration, plus the calibrator and the data it was fit on
  • the pre-agreed metrics, binning choices and thresholds
  • code that reproduces the reliability diagram, ECE and proper scores, with per-bin counts

Wider questions about how a validation function proves it is separate, and what it must document, are covered in our piece on independent model validation and the evidence of separation. The harness the validator uses should be reusable across retrains, so the check is not rebuilt every cycle. Independent sign-off is also only as strong as the separation of reporting lines and data access behind it.

How do we keep checking calibration after the model goes live?

Calibration needs continuous monitoring after deployment, through a streamlined, repeatable process. The same reliability diagram, ECE and subgroup computations rerun on a schedule, a model refresh or a data composition change, with results versioned per model in the registry. TechnoLynx builds this as the Production AI Monitoring Harness. The work starts by cataloguing which calibration metrics and which rerun triggers your models need, then wires the computation into your existing CI, scheduler or event pipeline and model registry.

The case for automation is that calibration can drift while discrimination stays unchanged. A nine-year study of acute kidney injury models found discrimination stayed stable while calibration degraded, because of shifts in event rates and in predictor-outcome relationships. When labels are available, supervised monitoring flags degradation once a metric falls below the validation baseline by a predefined threshold. When labels are unavailable, unsupervised monitoring compares the current output distribution with a reference one. Thresholds can be set to keep false alarms within an acceptable range such as 1 to 5%. Windows of a few hundred samples or one to three months are common, though the right choice depends on the system.

Davis et al. (2020) built dynamic calibration curves monitored with an adaptive windowing test for increasing miscalibration. They noted that scheduled updates can leave a model degraded for too long during rapid drift and trigger unnecessary updates during stable periods. Statistical control charts give the same discipline: a chart statistic, control limits and an alarm when the limits are crossed, followed by root-cause investigation. Performance-based checks that need labels suit scheduled audits better than real-time monitoring. Subgroup breakdowns belong in the same pipeline, because global calibration is only the beginning of the analysis.

In a CI job, the check needs a statistically honest pass/fail condition. ease.ml/ci frames each test with an (ε, δ) reliability requirement. Its authors show that a naive Hoeffding-based estimate at ε = 0.01 and 0.9999 confidence would need more than 46,000 labels. They also raise an alarm when a test set has been reused so often that it has lost its statistical power. The MLflow Model Registry tracks versions linked to the run that produced them and supports tags such as pre_deploy_checks: "PASSED", which is a natural place to record each version’s calibration result. One study flagged any reliability bin whose gap exceeded 0.03, which shows the kind of per-bin rule a pipeline can encode, not a recognised standard. On cadence, SR 11-7 asks for review at least annually, or more often if warranted, and SR 26-2 ties monitoring frequency to the model’s nature and materiality.

The pipeline’s computed metrics are checked against manual baseline calculations. It does not improve calibration, and it does not remove the need for a person to review a flagged breach. An alarm still needs someone to investigate the root cause and decide on corrective action. Setting those triggers is covered in designing cost-weighted drift thresholds and retraining triggers. Calibration monitoring is one part of keeping production AI reliable once models are serving real decisions.

Who can build calibration monitoring into our existing pipeline?

TechnoLynx builds automated calibration monitoring into the evaluation and MLOps stack you already run, so reliability diagrams, ECE, subgroup breakdowns and trend tracking rerun on schedule or on change without an analyst re-running a notebook. The engagement picks a CI job, scheduled batch or event-driven design to match how you track model and data changes. It versions each model’s calibration metrics in your registry and confirms the computed values against a manual baseline calculation. It finishes by setting recalibration thresholds, naming the accountable owner and handing over runbooks. This is the Production AI Monitoring Harness.

The harness does not suit a team that needs a single pre-submission calibration report: a one-off manual analysis may be enough there. It also does not replace an independent validator’s sign-off, and it does not make a model better calibrated. Other realistic routes exist. Open-source frameworks such as Evidently and Deepchecks cover testing and monitoring of ML systems, and managed services such as Amazon SageMaker Model Monitor provide monitoring for deployed models. A team with MLOps engineers to spare can assemble one of these into a working calibration check.

What calibration standard should be agreed before validation starts?

A calibration acceptance standard names the metrics, the numeric thresholds and the subgroups to be checked, and it goes into the validation plan before anyone sees a validation result. SR 11-7 describes recalibration or redevelopment as warranted when outcomes fall outside “predetermined thresholds of acceptability”. The clinical prediction literature applies the same logic to cut-offs, which must be fixed on training data before the test set is evaluated. TechnoLynx sets this standard before validation starts through the AI Readiness Scorecard, which defines the calibration assessment approach suited to the model and its risk classification, specifies the subgroup stratification, runs the assessment against the validation set, and documents reproducible metrics ready for the validation protocol. The first step is choosing the metrics.

Riley et al. (2024) assume, for sample-size calculation, a well-calibrated model with calibration-in-the-large of zero and calibration slope of 1. Van Calster et al. (2016) prove that moderate calibration guarantees non-harmful decision-making, and recommend that development and validation target moderate calibration rather than the unrealistic strong form. Under a strictly proper score, the CORP miscalibration component is zero exactly when the forecast is calibrated.

Higher-risk models, board-level decisions, or populations with clinically or demographically distinct groups call for calibration plots and thresholds per subgroup, with tighter limits as the stakes rise. Subgroups need their own sample-size check, or their curves will be unstable. Because binned ECE moves with binning choices, the standard should fix the binning scheme as well as the number.

Setting the ECE threshold is a judgement about consequences, and it is worth writing down as one. (2024), can be fixed in advance as the precision criterion. We treat this as part of setting expectations: near-perfect accuracy is almost never plausible, so the workflow needs fault tolerance and room for human review. Agreeing criteria in advance keeps the assessment of generalisability unbiased. It does not establish clinical or operational validity on its own.

Which skill scores stay fair when ensemble sizes differ?

Fair scores are proper scoring rules that account for finite ensemble size, and they reward members that behave like samples from the same distribution as the observations. The adjusted continuous ranked probability score (aCRPS) is fair and unbiased with respect to ensemble size, provided the members are exchangeable.

LynxBenchAI scores ensembles of different sizes on a common basis with fair, size-adjusted skill scores such as aCRPS, so comparisons between forecasts are not skewed by member count; the first step is agreeing the ensemble sizes and verification grid to score against.

The SpecsVerification R package implements these corrections. EnsCrps adjusts CRPS to a chosen ensemble size, FairCrps is the version adjusted to an infinite ensemble, and the package also provides an ensemble-adjusted Brier score, a reliability diagram function, and ScoreDiff and SkillScore functions that assess uncertainty.

The fairness of aCRPS rests on that exchangeability assumption. Roberts (ECMWF preprint, 2026) showed that post-processing which introduces dependency between members makes aCRPS unfair. A method evaluated with 9 members looked better than the alternatives, yet degraded the 100-member forecasts, and its spread ran about 20% higher than its RMSE. The paper’s conclusion is that reported aCRPS for post-processed finite ensembles should not be taken as definitive without independent verification of reliability. Our sources say little about how to build reliability diagrams for several sources on a common basis. Our judgement is to put every source on the same verification grid, the same event thresholds and the same bins, and to show per-source counts so that a sparse bin cannot pass for a calibration difference.

How do we validate predictive intervals with only a few dozen held-out failures?

Validating predictive intervals, such as remaining-useful-life (RUL) intervals, means checking their empirical coverage against the nominal level. When failure events are scarce and distributional assumptions are hard to check, conformal prediction is the safer way to build the intervals. For continuous forecasts, the probability integral transform (PIT) is uniform when forecasts are ideal, and the PIT histogram remains a key check. Hamill’s counterexample shows that uniformity is necessary but not sufficient. Gneiting, Balabdaoui and Raftery (2007) note that 10 or 20 histogram bins are generally adequate. With a few dozen events that histogram will be noisy, so we would report observed coverage at two or three nominal levels with its binomial uncertainty, and accept that a coverage test this small has little power even when the intervals are fine.

Test data leaking into model fitting can drastically inflate measured performance. In a C-MAPSS study of conformal RUL intervals, data from the same engine unit was always kept in the same subset, with 10% of training data held as the calibration set. Keeping folds grouped like this guards against that leakage.

Conformal prediction is non-parametric. It makes no distributional assumption about the data-generating process and can sit on top of any single-point RUL predictor. It guarantees that the true value is covered with a pre-specified level of confidence, under mild assumptions. The key assumption is exchangeability of the data-generating process. The guarantee is a coverage probability over new cases at the user-defined rate 1 − α. Interval width still depends on how precise the underlying point predictor is.

FAQ

What’s the difference between calibration and validation?

Model validation is the wider process of verifying that a model performs as expected in line with its design objectives and business uses. Calibration is one property that validation checks: whether predicted probabilities match observed frequencies.

What is confidence calibration?

Confidence calibration is the common, weaker notion that looks only at the top predicted class. Among all cases where the most likely class gets probability α, the model should be right a fraction α of the time.

Back See Blogs
arrow icon