Skip to main content

Module calibration

Module calibration 

Source
Expand description

Probability calibration — turn raw classifier scores into calibrated probabilities, and measure how well-calibrated they already are.

PlattScaling fits a logistic sigmoid(a·s + b); IsotonicRegression fits a monotone step function via pool-adjacent-violators (PAV). reliability_curve bins predictions against outcomes for a reliability diagram. All three operate on (score, label) vectors, independent of any model — so they calibrate a soft-vote, a decision function, or any score.

Structs§

CalibratedClassifier
Wrap a fitted binary ProbaPredictor and map its positive-class scores through a fitted calibrator, so predict_proba returns probabilities that mean what they say. This is the framework-native form of calibration: a CalibratedClassifier is itself a ProbaPredictor, so it composes.
IsotonicRegression
Isotonic regression: a non-decreasing step function fit by pool-adjacent-violators — a non-parametric calibrator.
PlattScaling
Platt scaling: a logistic map p = sigmoid(a·s + b) fit to binary outcomes.
ReliabilityBin
One bin of a reliability diagram.

Enums§

CalibrationMethod
Which calibration map a CalibratedClassifier fits.

Functions§

reliability_curve
Bin probs into bins equal-width buckets over [0, 1] and report the mean prediction vs. the observed positive rate in each — a perfectly calibrated model has mean_predicted == fraction_positive in every bin.