pub struct MultiTaskLassoCV<F> { /* private fields */ }Expand description
Multi-task Lasso regression with built-in cross-validation for alpha selection.
The l1_ratio = 1.0 specialization of MultiTaskElasticNetCV: it
auto-generates the L21 alpha grid, runs k-fold CV fitting a
crate::MultiTaskLasso per fold, selects the alpha minimizing mean CV MSE,
and refits on the full data. Has NO l1_ratio parameter.
Mirrors sklearn.linear_model.MultiTaskLassoCV
(_coordinate_descent.py:3061).
§Type Parameters
F: The floating-point type (f32orf64).
Implementations§
Source§impl<F: Float + FromPrimitive> MultiTaskLassoCV<F>
impl<F: Float + FromPrimitive> MultiTaskLassoCV<F>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new MultiTaskLassoCV with default settings.
Defaults mirror sklearn.linear_model.MultiTaskLassoCV.__init__
(_coordinate_descent.py:3228-3256):
n_alphas = 100cv = 5max_iter = 1000tol = 1e-4fit_intercept = true
There is NO l1_ratio parameter (fixed at 1.0).
Sourcepub fn with_n_alphas(self, n_alphas: usize) -> Self
pub fn with_n_alphas(self, n_alphas: usize) -> Self
Set the number of alphas generated for the path.
Sourcepub fn with_cv(self, cv: usize) -> Self
pub fn with_cv(self, cv: usize) -> Self
Set the number of cross-validation folds (must be at least 2).
Sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
Set the maximum number of block-coordinate-descent iterations.
Sourcepub fn with_fit_intercept(self, fit_intercept: bool) -> Self
pub fn with_fit_intercept(self, fit_intercept: bool) -> Self
Set whether to fit per-task intercept terms.
Trait Implementations§
Source§impl<F: Clone> Clone for MultiTaskLassoCV<F>
impl<F: Clone> Clone for MultiTaskLassoCV<F>
Source§fn clone(&self) -> MultiTaskLassoCV<F>
fn clone(&self) -> MultiTaskLassoCV<F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for MultiTaskLassoCV<F>
impl<F: Debug> Debug for MultiTaskLassoCV<F>
Source§impl<F: Float + FromPrimitive> Default for MultiTaskLassoCV<F>
impl<F: Float + FromPrimitive> Default for MultiTaskLassoCV<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + FromPrimitive + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for MultiTaskLassoCV<F>
impl<F: Float + Send + Sync + ScalarOperand + FromPrimitive + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for MultiTaskLassoCV<F>
Source§fn fit(
&self,
x: &Array2<F>,
y: &Array2<F>,
) -> Result<FittedMultiTaskLassoCV<F>, FerroError>
fn fit( &self, x: &Array2<F>, y: &Array2<F>, ) -> Result<FittedMultiTaskLassoCV<F>, FerroError>
Fit the MultiTaskLassoCV model by delegating to
MultiTaskElasticNetCV with l1_ratio fixed to 1.0.
§Errors
Forwards every error from the delegated MultiTaskElasticNetCV::fit
(shape mismatch, invalid parameters, insufficient samples, non-finite
input).
Source§type Fitted = FittedMultiTaskLassoCV<F>
type Fitted = FittedMultiTaskLassoCV<F>
fit.Source§type Error = FerroError
type Error = FerroError
fit.Auto Trait Implementations§
impl<F> Freeze for MultiTaskLassoCV<F>where
F: Freeze,
impl<F> RefUnwindSafe for MultiTaskLassoCV<F>where
F: RefUnwindSafe,
impl<F> Send for MultiTaskLassoCV<F>where
F: Send,
impl<F> Sync for MultiTaskLassoCV<F>where
F: Sync,
impl<F> Unpin for MultiTaskLassoCV<F>where
F: Unpin,
impl<F> UnsafeUnpin for MultiTaskLassoCV<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for MultiTaskLassoCV<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
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>
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>
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