pub struct FixedThresholdClassifier<E> { /* private fields */ }Expand description
Fixed threshold classifier wrapper
Applies a fixed decision threshold to a probabilistic classifier’s predictions.
Implementations§
Source§impl<E> FixedThresholdClassifier<E>
impl<E> FixedThresholdClassifier<E>
Sourcepub fn pos_label_idx(self, idx: usize) -> Self
pub fn pos_label_idx(self, idx: usize) -> Self
Set the positive label index for multiclass
Sourcepub fn get_threshold(&self) -> f64
pub fn get_threshold(&self) -> f64
Get the threshold value
Trait Implementations§
Source§impl<E: Clone> Clone for FixedThresholdClassifier<E>
impl<E: Clone> Clone for FixedThresholdClassifier<E>
Source§fn clone(&self) -> FixedThresholdClassifier<E>
fn clone(&self) -> FixedThresholdClassifier<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E: Debug> Debug for FixedThresholdClassifier<E>
impl<E: Debug> Debug for FixedThresholdClassifier<E>
Source§impl<'a, E, F: FloatBounds> Fit<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<ViewRepr<&'a usize>, Dim<[usize; 1]>>> for FixedThresholdClassifier<E>
impl<'a, E, F: FloatBounds> Fit<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<ViewRepr<&'a usize>, Dim<[usize; 1]>>> for FixedThresholdClassifier<E>
Source§type Fitted = FixedThresholdClassifier<<E as Fit<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<ViewRepr<&'a usize>, Dim<[usize; 1]>>>>::Fitted>
type Fitted = FixedThresholdClassifier<<E as Fit<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<ViewRepr<&'a usize>, Dim<[usize; 1]>>>>::Fitted>
The fitted model type
Source§fn fit(
self,
x: &ArrayView2<'a, F>,
y: &ArrayView1<'a, usize>,
) -> Result<Self::Fitted>
fn fit( self, x: &ArrayView2<'a, F>, y: &ArrayView1<'a, usize>, ) -> Result<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Source§impl<'a, E, F: FloatBounds> Predict<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>> for FixedThresholdClassifier<E>
impl<'a, E, F: FloatBounds> Predict<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>> for FixedThresholdClassifier<E>
Source§fn predict(&self, x: &ArrayView2<'a, F>) -> Result<Array1<usize>>
fn predict(&self, x: &ArrayView2<'a, F>) -> Result<Array1<usize>>
Make predictions on the provided data
Source§fn predict_with_uncertainty(
&self,
x: &X,
) -> Result<(Output, UncertaintyMeasure), SklearsError>
fn predict_with_uncertainty( &self, x: &X, ) -> Result<(Output, UncertaintyMeasure), SklearsError>
Make predictions with confidence intervals
Source§impl<'a, E, F: FloatBounds> PredictProba<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FixedThresholdClassifier<E>
impl<'a, E, F: FloatBounds> PredictProba<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FixedThresholdClassifier<E>
Source§fn predict_proba(&self, x: &ArrayView2<'a, F>) -> Result<Array2<F>>
fn predict_proba(&self, x: &ArrayView2<'a, F>) -> Result<Array2<F>>
Predict class probabilities
Auto Trait Implementations§
impl<E> Freeze for FixedThresholdClassifier<E>where
E: Freeze,
impl<E> RefUnwindSafe for FixedThresholdClassifier<E>where
E: RefUnwindSafe,
impl<E> Send for FixedThresholdClassifier<E>where
E: Send,
impl<E> Sync for FixedThresholdClassifier<E>where
E: Sync,
impl<E> Unpin for FixedThresholdClassifier<E>where
E: Unpin,
impl<E> UnwindSafe for FixedThresholdClassifier<E>where
E: UnwindSafe,
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
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