pub struct FittedRidgeClassifier<F> { /* private fields */ }Expand description
Fitted Ridge Classifier.
Stores the learned coefficient matrix, intercept vector, and class labels.
Implementations§
Source§impl<F: Float> FittedRidgeClassifier<F>
impl<F: Float> FittedRidgeClassifier<F>
Sourcepub fn coef_matrix(&self) -> &Array2<F>
pub fn coef_matrix(&self) -> &Array2<F>
Returns the full coefficient matrix, shape (n_features, n_targets).
Sourcepub fn intercept_vec(&self) -> &Array1<F>
pub fn intercept_vec(&self) -> &Array1<F>
Returns the intercept vector.
Source§impl<F: Float + ScalarOperand + Send + Sync + 'static> FittedRidgeClassifier<F>
impl<F: Float + ScalarOperand + Send + Sync + 'static> FittedRidgeClassifier<F>
Sourcepub fn decision_function(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
pub fn decision_function(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Raw X @ coef + intercept per class. Mirrors sklearn
RidgeClassifier.decision_function.
Returns shape (n_samples, n_classes). argmax of each row agrees
with Predict.
§Errors
Returns FerroError::ShapeMismatch if the number of features
does not match the fitted model.
Trait Implementations§
Source§impl<F: Clone> Clone for FittedRidgeClassifier<F>
impl<F: Clone> Clone for FittedRidgeClassifier<F>
Source§fn clone(&self) -> FittedRidgeClassifier<F>
fn clone(&self) -> FittedRidgeClassifier<F>
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<F: Debug> Debug for FittedRidgeClassifier<F>
impl<F: Debug> Debug for FittedRidgeClassifier<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> HasClasses for FittedRidgeClassifier<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> HasClasses for FittedRidgeClassifier<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> HasCoefficients<F> for FittedRidgeClassifier<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> HasCoefficients<F> for FittedRidgeClassifier<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedRidgeClassifier<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedRidgeClassifier<F>
Source§fn predict(&self, x: &Array2<F>) -> Result<Array1<usize>, FerroError>
fn predict(&self, x: &Array2<F>) -> Result<Array1<usize>, FerroError>
Predict class labels for the given feature matrix.
Computes X @ coef_matrix + intercept_vec and takes argmax per row.
§Errors
Returns FerroError::ShapeMismatch if the number of features
does not match the fitted model.
Source§type Output = ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>
type Output = ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>
The prediction output type (e.g.,
ndarray::Array1<F> or ndarray::Array1<usize>).Source§type Error = FerroError
type Error = FerroError
The error type returned by
predict.Auto Trait Implementations§
impl<F> Freeze for FittedRidgeClassifier<F>where
F: Freeze,
impl<F> RefUnwindSafe for FittedRidgeClassifier<F>where
F: RefUnwindSafe,
impl<F> Send for FittedRidgeClassifier<F>where
F: Send,
impl<F> Sync for FittedRidgeClassifier<F>where
F: Sync,
impl<F> Unpin for FittedRidgeClassifier<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedRidgeClassifier<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FittedRidgeClassifier<F>where
F: UnwindSafe + RefUnwindSafe,
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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