Struct smartcore::linear::elastic_net::ElasticNetParameters
source · pub struct ElasticNetParameters {
pub alpha: f64,
pub l1_ratio: f64,
pub normalize: bool,
pub tol: f64,
pub max_iter: usize,
}
Expand description
Elastic net parameters
Fields§
§alpha: f64
Regularization parameter.
l1_ratio: f64
The elastic net mixing parameter, with 0 <= l1_ratio <= 1. For l1_ratio = 0 the penalty is an L2 penalty. For l1_ratio = 1 it is an L1 penalty. For 0 < l1_ratio < 1, the penalty is a combination of L1 and L2.
normalize: bool
If True, the regressors X will be normalized before regression by subtracting the mean and dividing by the standard deviation.
tol: f64
The tolerance for the optimization
max_iter: usize
The maximum number of iterations
Implementations§
source§impl ElasticNetParameters
impl ElasticNetParameters
sourcepub fn with_alpha(self, alpha: f64) -> Self
pub fn with_alpha(self, alpha: f64) -> Self
Regularization parameter.
sourcepub fn with_l1_ratio(self, l1_ratio: f64) -> Self
pub fn with_l1_ratio(self, l1_ratio: f64) -> Self
The elastic net mixing parameter, with 0 <= l1_ratio <= 1. For l1_ratio = 0 the penalty is an L2 penalty. For l1_ratio = 1 it is an L1 penalty. For 0 < l1_ratio < 1, the penalty is a combination of L1 and L2.
sourcepub fn with_normalize(self, normalize: bool) -> Self
pub fn with_normalize(self, normalize: bool) -> Self
If True, the regressors X will be normalized before regression by subtracting the mean and dividing by the standard deviation.
sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
The maximum number of iterations
Trait Implementations§
source§impl Clone for ElasticNetParameters
impl Clone for ElasticNetParameters
source§fn clone(&self) -> ElasticNetParameters
fn clone(&self) -> ElasticNetParameters
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more