Package smile.classification
Class IsotonicRegressionScaling
java.lang.Object
smile.classification.IsotonicRegressionScaling
- All Implemented Interfaces:
Serializable
A method to calibrate decision function value to probability.
Compared to Platt's scaling, this approach fits a piecewise-constant
non-decreasing function instead of logistic regression.
References
- Alexandru Niculescu-Mizil and Rich Caruana. Predicting Good Probabilities With Supervised Learning. ICML, 2005.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IsotonicRegressionScaling
fit
(double[] scores, int[] y) Trains the Isotonic Regression scaling.double
predict
(double y) Returns the posterior probability estimate P(y = 1 | x).toString()
-
Constructor Details
-
IsotonicRegressionScaling
public IsotonicRegressionScaling(double[] buckets, double[] prob) Constructor.- Parameters:
buckets
- the step-wise buckets of function values in ascending order.prob
- the probability of instances falling into the corresponding buckets.
-
-
Method Details
-
fit
Trains the Isotonic Regression scaling.- Parameters:
scores
- The predicted scores.y
- The training labels.- Returns:
- the model.
-
predict
public double predict(double y) Returns the posterior probability estimate P(y = 1 | x).- Parameters:
y
- the binary classifier output score.- Returns:
- the estimated probability.
-
toString
-