pub struct LassoParams<F>(/* private fields */);Expand description
A hyper-parameter set during construction
Configures and minimizes the following objective function:
1 / (2 * n_samples) * ||y - Xw||^2_2
+ alpha * ||w||_1Implementations§
Source§impl<F: Float> LassoParams<F>
Configure and fit a Lasso model
impl<F: Float> LassoParams<F>
Configure and fit a Lasso model
Sourcepub fn new() -> LassoParams<F>
pub fn new() -> LassoParams<F>
Create default Lasso hyper parameters
Sourcepub fn alpha(self, alpha: F) -> Self
pub fn alpha(self, alpha: F) -> Self
Set the regularization hyperparameter. A higher value yields sparser
solutions.
Defaults to 1 if not set.
Sourcepub fn max_iterations(self, max_iterations: usize) -> Self
pub fn max_iterations(self, max_iterations: usize) -> Self
Set the maximum number of iterations in the outer loop used to build
working set.
Defaults to 50 if not set.
Sourcepub fn max_epochs(self, max_epochs: usize) -> Self
pub fn max_epochs(self, max_epochs: usize) -> Self
Set the maximum number of epochs in the inner loop during the descent
routine.
Defaults to 1000 if not set.
Sourcepub fn ws_start_size(self, ws_start_size: usize) -> Self
pub fn ws_start_size(self, ws_start_size: usize) -> Self
Set the initial working set size.
Defaults to 10 if not set.
Sourcepub fn tolerance(self, tolerance: F) -> Self
pub fn tolerance(self, tolerance: F) -> Self
Set the stopping criterion for the optimization routine (KKT violation).
Defaults to 1e-6 if not set.
Sourcepub fn K(self, K: usize) -> Self
pub fn K(self, K: usize) -> Self
Set the number of points used for extrapolation.
Defaults to 5 if not set.
Sourcepub fn use_acceleration(self, use_acceleration: bool) -> Self
pub fn use_acceleration(self, use_acceleration: bool) -> Self
Enables the use of Anderson acceleration for the extrapolation of
primal iterates.
Defaults to true if not set.
Trait Implementations§
Source§impl<F: Clone> Clone for LassoParams<F>
impl<F: Clone> Clone for LassoParams<F>
Source§fn clone(&self) -> LassoParams<F>
fn clone(&self) -> LassoParams<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for LassoParams<F>
impl<F: Debug> Debug for LassoParams<F>
Source§impl<F: Float> Default for LassoParams<F>
impl<F: Float> Default for LassoParams<F>
Source§impl<F: Float> ParamGuard for LassoParams<F>
impl<F: Float> ParamGuard for LassoParams<F>
Source§type Checked = LassoValidParams<F>
type Checked = LassoValidParams<F>
Source§type Error = EstimatorError
type Error = EstimatorError
Source§fn check(self) -> Result<Self::Checked>
fn check(self) -> Result<Self::Checked>
Source§fn check_unwrap(self) -> Self::Checkedwhere
Self: Sized,
fn check_unwrap(self) -> Self::Checkedwhere
Self: Sized,
check() and unwraps the resultSource§impl<F: PartialEq> PartialEq for LassoParams<F>
impl<F: PartialEq> PartialEq for LassoParams<F>
impl<F> StructuralPartialEq for LassoParams<F>
Auto Trait Implementations§
impl<F> Freeze for LassoParams<F>where
F: Freeze,
impl<F> RefUnwindSafe for LassoParams<F>where
F: RefUnwindSafe,
impl<F> Send for LassoParams<F>where
F: Send,
impl<F> Sync for LassoParams<F>where
F: Sync,
impl<F> Unpin for LassoParams<F>where
F: Unpin,
impl<F> UnwindSafe for LassoParams<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> 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