Inferensys

Glossary

Platt Scaling

Platt Scaling is a parametric calibration technique that fits a logistic regression model to the raw outputs of a classifier to transform them into calibrated posterior probabilities.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
CALIBRATION TECHNIQUE

What is Platt Scaling?

A parametric method for transforming classifier scores into calibrated posterior probabilities by fitting a logistic regression model to the raw outputs.

Platt scaling is a post-hoc calibration technique that learns a sigmoid function mapping a classifier's raw scores to well-calibrated probability estimates. It fits a logistic regression model on a held-out validation set, optimizing two scalar parameters to minimize the negative log-likelihood of the predicted probabilities against the true binary labels.

Originally developed for Support Vector Machines, which output uncalibrated distance scores, Platt scaling is now widely applied to modern neural networks. It assumes the relationship between raw scores and empirical probabilities follows a logistic curve, making it a parametric alternative to non-parametric methods like isotonic regression, and is particularly effective when calibration errors are symmetric.

PARAMETRIC CALIBRATION

Key Characteristics of Platt Scaling

Platt Scaling is a post-hoc calibration method that fits a logistic regression model to the raw outputs of a classifier to produce well-calibrated posterior probabilities. It is particularly effective for models with sigmoidal-shaped distortion in their reliability diagrams.

01

Logistic Sigmoid Transformation

Platt Scaling learns a scalar A and B parameter to transform raw classifier scores f(x) into calibrated probabilities: P(y=1 | f) = 1 / (1 + exp(A * f + B)). The parameter A controls the slope of the sigmoid, sharpening or softening probabilities, while B shifts the decision threshold. This parametric form assumes the relationship between raw scores and empirical frequencies follows a logistic curve, making it ideal for Support Vector Machines and other maximum-margin classifiers that exhibit sigmoidal distortion.

02

Training on a Held-Out Calibration Set

The parameters A and B are optimized using maximum likelihood estimation on a dedicated calibration dataset, distinct from both training and test sets. Using the same data for training and calibration introduces severe overfitting bias, producing unrealistically low calibration errors. The logistic regression model is trained with the raw classifier scores as the single input feature and the binary ground-truth labels as targets. Cross-validation on the training set can generate out-of-fold predictions for calibration when data is scarce.

03

Avoiding Overfitting with Out-of-Sample Strategy

A critical implementation detail is ensuring the calibration set is strictly independent of the data used to train the base classifier. The standard protocol involves a three-way split:

  • Training set: Fits the base classifier parameters
  • Calibration set: Fits the Platt Scaling parameters A and B
  • Test set: Evaluates the final Expected Calibration Error (ECE) Failing to maintain this separation leads to optimistic calibration estimates that do not generalize to production data.
04

Comparison to Temperature Scaling

Platt Scaling is a two-parameter generalization of Temperature Scaling. Temperature Scaling divides all logits by a single scalar T, which is equivalent to Platt Scaling with B fixed at 0. The additional bias term B in Platt Scaling allows it to correct systematic overconfidence or underconfidence that is not centered around zero. For modern neural networks, Temperature Scaling often matches Platt Scaling's performance while being simpler, but Platt Scaling remains superior when the base classifier exhibits asymmetric confidence distortion.

05

Assumptions and Failure Modes

Platt Scaling assumes the raw classifier scores are monotonically related to the true posterior probabilities. It fails when:

  • The score distribution is non-monotonic, where higher scores do not consistently indicate higher empirical accuracy
  • The base model produces pathological score distributions with heavy tails or multi-modal behavior
  • The calibration dataset is too small, causing high-variance estimates of A and B In these cases, non-parametric methods like Isotonic Regression may be more appropriate despite their higher data requirements.
06

Historical Origin and SVM Context

John Platt introduced this method in 1999 specifically to extract calibrated probabilities from Support Vector Machines, which natively output an uncalibrated signed distance from the decision boundary. The technique transformed SVMs from pure discriminative classifiers into probabilistic models suitable for decision-theoretic applications like cost-sensitive classification and reject-option scenarios. The original paper demonstrated that the sigmoid mapping consistently improved probability estimates over naive normalization of SVM outputs.

CALIBRATION TECHNIQUE COMPARISON

Platt Scaling vs. Other Calibration Methods

A feature-level comparison of Platt Scaling against Temperature Scaling and Isotonic Regression for post-hoc probability calibration.

FeaturePlatt ScalingTemperature ScalingIsotonic Regression

Model Type

Parametric

Parametric

Non-Parametric

Functional Form

Logistic sigmoid

Scalar logit divisor

Piecewise constant monotonic

Parameters Learned

2 (A, B)

1 (T)

Variable (bin thresholds)

Preserves Rank Order

Multiclass Extension

One-vs-rest or matrix

Single scalar per model

One-vs-rest per class

Risk of Overfitting

Low (2 params)

Very low (1 param)

High on small datasets

Validation Set Size Needed

Moderate

Small

Large

Assumes Sigmoid Shape

PLATT SCALING

Frequently Asked Questions

Clear, technical answers to the most common questions about Platt scaling, its implementation, and its role in confidence calibration.

Platt scaling is a parametric calibration method that transforms the raw, uncalibrated output scores of a binary classifier into well-calibrated posterior probabilities. It works by fitting a logistic regression model on top of the classifier's raw scores (logits or SVM margins) using a held-out validation set. The transformation learns two scalar parameters, A and B, such that the calibrated probability P(y=1|x) equals 1 / (1 + exp(A * f(x) + B)), where f(x) is the raw classifier output. The parameters are optimized by minimizing the negative log-likelihood on the calibration set, effectively finding the sigmoid function that best maps scores to empirical class frequencies. Unlike histogram binning, Platt scaling assumes a smooth, monotonic relationship between scores and probabilities, making it particularly effective when the raw scores are roughly normally distributed per class. It was originally introduced by John Platt in 1999 to convert Support Vector Machine (SVM) decision values into probabilistic outputs but is now widely applied to neural network logits as a lightweight post-hoc calibrator.

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.