Module linfa::composing::platt_scaling
source · Expand description
Implement Platt calibration with Newton method
Platt scaling is a way of transforming the outputs of a classification model into a probability distribution over classes. It is, for example, used in the calibration of SVM models to predict plausible probability values.
§Example
ⓘ
let model = ...;
let model = Platt::params()
.fit_with(model, &train)?;
let pred: Array1<Pr> = model.predict(&valid);
Structs§
- Fitted Platt model
- Parameters for Platt’s Newton method
Enums§
- Platt Newton’s method errors
Functions§
- Run Newton’s method to find optimal
A
andB
values - Predict a probability with the sigmoid function