pub struct QDA<F> {
pub reg_param: F,
}Expand description
Fields§
§reg_param: FRegularization parameter for covariance matrices.
Blends each class covariance toward the identity:
Sigma_k = (1 - reg) * Sigma_k + reg * I.
Must be in [0, 1]. Default: 0.0.
Implementations§
Trait Implementations§
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>> for QDA<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>> for QDA<F>
Source§fn fit(
&self,
x: &Array2<F>,
y: &Array1<usize>,
) -> Result<FittedQDA<F>, FerroError>
fn fit( &self, x: &Array2<F>, y: &Array1<usize>, ) -> Result<FittedQDA<F>, FerroError>
Fit the QDA model by computing per-class means and covariances.
§Errors
FerroError::ShapeMismatch— sample count mismatch.FerroError::InsufficientSamples— fewer than 2 distinct classes or a class has too few samples.FerroError::InvalidParameter—reg_paramnot in[0, 1].FerroError::NumericalInstability— covariance matrix is singular.
Source§type Error = FerroError
type Error = FerroError
The error type returned by
fit.Auto Trait Implementations§
impl<F> Freeze for QDA<F>where
F: Freeze,
impl<F> RefUnwindSafe for QDA<F>where
F: RefUnwindSafe,
impl<F> Send for QDA<F>where
F: Send,
impl<F> Sync for QDA<F>where
F: Sync,
impl<F> Unpin for QDA<F>where
F: Unpin,
impl<F> UnsafeUnpin for QDA<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for QDA<F>where
F: 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> 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