pub struct FittedRidgeMulti<F> { /* private fields */ }Expand description
Fitted multi-output Ridge regression model.
Companion to FittedRidge for the case where Y has multiple
target columns. Stores a (n_features, n_targets) coefficient matrix
and a per-target intercept vector. The Cholesky factor of
X^T X + alpha * I is computed once during Ridge::fit and shared
across all targets, so multi-output fitting costs the same O(p^3)
factorization as the single-output path.
Implementations§
Source§impl<F: Float> FittedRidgeMulti<F>
impl<F: Float> FittedRidgeMulti<F>
Sourcepub fn coefficients(&self) -> &Array2<F>
pub fn coefficients(&self) -> &Array2<F>
Borrow the learned coefficient matrix (n_features, n_targets).
Sourcepub fn intercepts(&self) -> &Array1<F>
pub fn intercepts(&self) -> &Array1<F>
Borrow the per-target intercept vector (n_targets,).
Trait Implementations§
Source§impl<F: Clone> Clone for FittedRidgeMulti<F>
impl<F: Clone> Clone for FittedRidgeMulti<F>
Source§fn clone(&self) -> FittedRidgeMulti<F>
fn clone(&self) -> FittedRidgeMulti<F>
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<F: Debug> Debug for FittedRidgeMulti<F>
impl<F: Debug> Debug for FittedRidgeMulti<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedRidgeMulti<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedRidgeMulti<F>
Source§fn predict(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn predict(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Predict target values for the given feature matrix.
Computes X @ coefficients + intercepts and returns an
(n_samples, n_targets) array.
§Errors
Returns FerroError::ShapeMismatch if the number of features
does not match the fitted model.
Source§type Output = ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>
type Output = ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>
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 FittedRidgeMulti<F>
impl<F> RefUnwindSafe for FittedRidgeMulti<F>where
F: RefUnwindSafe,
impl<F> Send for FittedRidgeMulti<F>where
F: Send,
impl<F> Sync for FittedRidgeMulti<F>where
F: Sync,
impl<F> Unpin for FittedRidgeMulti<F>
impl<F> UnsafeUnpin for FittedRidgeMulti<F>
impl<F> UnwindSafe for FittedRidgeMulti<F>where
F: 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,
impl<T, U> Imply<T> for U
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