pub struct ElasticNet { /* private fields */ }Expand description
Minimises 1/(2n) ‖y - Xw - b‖² + α (ρ ‖w‖₁ + (1-ρ)/2 ‖w‖²).
The L1 part (ρ, the l1_ratio) drives some weights exactly to zero, selecting features; the L2
part stabilises the solution when features are correlated. l1_ratio = 1 is the lasso and 0
is (a scaled) ridge. Coordinate descent updates one weight at a time with a closed-form
soft-threshold step until the largest change falls below tolerance.
Implementations§
Trait Implementations§
Source§impl Clone for ElasticNet
impl Clone for ElasticNet
Source§impl Debug for ElasticNet
impl Debug for ElasticNet
Auto Trait Implementations§
impl Freeze for ElasticNet
impl RefUnwindSafe for ElasticNet
impl Send for ElasticNet
impl Sync for ElasticNet
impl Unpin for ElasticNet
impl UnsafeUnpin for ElasticNet
impl UnwindSafe for ElasticNet
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