pub struct IsotonicRegression {
pub thresholds: Vec<f32>,
pub values: Vec<f32>,
}Expand description
Isotonic Regression calibrator.
Non-parametric calibration method that fits a monotonically increasing step function to the data. Guaranteed to be monotonic.
§Reference
- Zadrozny, B., & Elkan, C. (2002). Transforming classifier scores into accurate multiclass probability estimates.
Fields§
§thresholds: Vec<f32>Threshold values (sorted)
values: Vec<f32>Calibrated values at each threshold
Implementations§
Source§impl IsotonicRegression
impl IsotonicRegression
Sourcepub fn new() -> IsotonicRegression
pub fn new() -> IsotonicRegression
Create a new isotonic regression calibrator.
Sourcepub fn fit(&mut self, predictions: &[f32], labels: &[bool])
pub fn fit(&mut self, predictions: &[f32], labels: &[bool])
Fit isotonic regression on predictions and labels.
Uses Pool Adjacent Violators (PAV) algorithm.
Sourcepub fn predict_batch(&self, predictions: &[f32]) -> Vec<f32>
pub fn predict_batch(&self, predictions: &[f32]) -> Vec<f32>
Get calibrated probabilities for multiple predictions.
Trait Implementations§
Source§impl Clone for IsotonicRegression
impl Clone for IsotonicRegression
Source§fn clone(&self) -> IsotonicRegression
fn clone(&self) -> IsotonicRegression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IsotonicRegression
impl Debug for IsotonicRegression
Source§impl Default for IsotonicRegression
impl Default for IsotonicRegression
Source§fn default() -> IsotonicRegression
fn default() -> IsotonicRegression
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IsotonicRegression
impl RefUnwindSafe for IsotonicRegression
impl Send for IsotonicRegression
impl Sync for IsotonicRegression
impl Unpin for IsotonicRegression
impl UnsafeUnpin for IsotonicRegression
impl UnwindSafe for IsotonicRegression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more