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§
- Calibrated
Classifier - Wrap a fitted binary
ProbaPredictorand map its positive-class scores through a fitted calibrator, sopredict_probareturns probabilities that mean what they say. This is the framework-native form of calibration: aCalibratedClassifieris itself aProbaPredictor, so it composes. - Isotonic
Regression - Isotonic regression: a non-decreasing step function fit by pool-adjacent-violators — a non-parametric calibrator.
- Platt
Scaling - Platt scaling: a logistic map
p = sigmoid(a·s + b)fit to binary outcomes. - Reliability
Bin - One bin of a reliability diagram.
Enums§
- Calibration
Method - Which calibration map a
CalibratedClassifierfits.
Functions§
- reliability_
curve - Bin
probsintobinsequal-width buckets over[0, 1]and report the mean prediction vs. the observed positive rate in each — a perfectly calibrated model hasmean_predicted == fraction_positivein every bin.