Inferensys

Glossary

Calibration

The process of aligning a model's predicted probability of an event with the true empirical frequency of that event occurring, ensuring that a predicted 5% CTR actually corresponds to a 5% observed click rate.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
PROBABILISTIC ACCURACY

What is Calibration?

Calibration is the process of aligning a model's predicted probability of an event with the true empirical frequency of that event occurring, ensuring that a predicted 5% CTR actually corresponds to a 5% observed click rate.

Calibration is the process of aligning a model's predicted probability of an event, such as a click, with the true empirical frequency of that event occurring. A perfectly calibrated model ensures that among all instances receiving a predicted score of p, exactly p percent of them actually manifest the positive class, making the output a reliable statistical estimate rather than just a ranking signal.

Miscalibration is commonly measured using Expected Calibration Error (ECE) or visualized via reliability diagrams, which bin predictions and plot predicted probability against observed frequency. Post-hoc correction techniques like Platt scaling and isotonic regression are applied to a held-out validation set to adjust raw model logits without retraining, a critical step for downstream systems that consume probabilities for bidding or risk assessment.

PROBABILISTIC FIDELITY

Key Characteristics of Calibration

Calibration ensures a model's predicted probability reflects the true likelihood of an event. A perfectly calibrated model predicting a 10% click-through rate will observe a click exactly 10% of the time.

01

Reliability Diagrams

Also known as calibration plots, these are the primary visual diagnostic tool. Predictions are bucketed into intervals (e.g., 0-10%, 10-20%), and the mean predicted probability is plotted against the true empirical frequency for each bucket. A perfectly calibrated model traces the diagonal y=x line. Deviations above the diagonal indicate underconfidence, while deviations below indicate overconfidence.

02

Expected Calibration Error (ECE)

The definitive scalar metric summarizing miscalibration. ECE computes the weighted average of the absolute difference between accuracy and confidence across all prediction bins.

  • Formula: ECE = Σ (|B_m| / n) * |acc(B_m) - conf(B_m)|
  • Interpretation: A lower ECE is better. An ECE of 0.05 means the model's probability estimates are off by 5% on average.
  • Limitation: ECE is sensitive to binning strategy; a fixed number of bins (e.g., 10) is standard.
0.00
Perfect ECE Score
03

Platt Scaling

A post-hoc calibration method that fits a logistic regression model on the raw outputs (logits) of a classifier against the true labels. It learns scalar parameters A and B to transform logits into calibrated probabilities: P(y=1|x) = 1 / (1 + exp(A * logit + B)). Platt scaling is highly effective for binary classification and is trained on a held-out validation set to avoid overfitting the correction.

04

Isotonic Regression

A non-parametric calibration method that learns a piecewise constant, monotonically increasing function to map model scores to empirical probabilities. Unlike Platt scaling, it makes no assumption about the functional form of the distortion.

  • Advantage: More flexible; can correct any monotonic miscalibration.
  • Disadvantage: Prone to overfitting with small datasets, as it learns a step function directly from the data.
05

Temperature Scaling

A simple yet highly effective calibration method for multi-class neural networks. A single scalar parameter T (temperature) divides all logits before the softmax function: q_i = exp(z_i / T) / Σ exp(z_j / T). A T > 1 'softens' the probabilities, reducing overconfidence. Optimized on NLL on a validation set, it preserves accuracy while dramatically improving ECE.

06

Sharpness vs. Calibration

A critical distinction. Sharpness refers to the concentration of predictions near 0 or 1, reflecting decisiveness. Calibration is the statistical correctness of those probabilities. A model can be perfectly calibrated but uselessly unsharp (e.g., always predicting the base rate of 5% CTR). Conversely, a sharp but miscalibrated model is dangerously overconfident. The goal is to optimize for both.

CALIBRATION CLARITY

Frequently Asked Questions

Precise answers to the most common technical questions about probability calibration in machine learning, covering reliability diagrams, Platt scaling, and isotonic regression.

Probability calibration is the process of aligning a model's predicted probability of an event with the true empirical frequency of that event occurring. A perfectly calibrated model means that among all predictions assigned a 5% click-through rate, exactly 5% of those instances actually resulted in a click. Modern deep neural networks and complex ensemble methods like gradient-boosted trees often produce overconfident or underconfident probabilities despite achieving high ranking accuracy measured by AUC. Calibration is critical in cost-sensitive decisioning systems—such as real-time bidding platforms—where the predicted probability directly determines the bid price. Without calibration, a model predicting a 10% conversion rate when the true rate is 2% leads to systematic overpayment and inefficient budget allocation.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.