Struct linfa_elasticnet::ElasticNet
source · pub struct ElasticNet<F> { /* private fields */ }
Expand description
Elastic Net model
This struct contains the parameters of a fitted elastic net model. This includes the seperating hyperplane, (optionally) intercept, duality gaps and the number of step needed in the computation.
Model implementation
The coordinate descent algorithm is used to solve the lasso and ridge problem. It optimizes each parameter seperately, holding all the others fixed. This cycles as long as the coefficients have not stabilized or the maximum number of iterations is reached.
See also:
Implementations§
source§impl<F: Float> ElasticNet<F>
impl<F: Float> ElasticNet<F>
View the fitted parameters and make predictions with a fitted elastic net model
sourcepub fn hyperplane(&self) -> &Array1<F>
pub fn hyperplane(&self) -> &Array1<F>
Get the fitted hyperplane
sourcepub fn duality_gap(&self) -> F
pub fn duality_gap(&self) -> F
Get the duality gap at the end of the optimization algorithm
sourcepub fn confidence_95th(&self) -> Result<Array1<(F, F)>>
pub fn confidence_95th(&self) -> Result<Array1<(F, F)>>
Calculate the confidence level
source§impl<F: Float> ElasticNet<F>
impl<F: Float> ElasticNet<F>
sourcepub fn params() -> ElasticNetParams<F>
pub fn params() -> ElasticNetParams<F>
Create a default parameter set for construction of ElasticNet model
By default, an intercept will be fitted. To disable fitting an
intercept, call .with_intercept(false)
before calling .fit()
.
To additionally normalize the feature matrix before fitting, call
fit_intercept_and_normalize()
before calling fit()
. The feature
matrix will not be normalized by default.
sourcepub fn ridge() -> ElasticNetParams<F>
pub fn ridge() -> ElasticNetParams<F>
Create a ridge only model
sourcepub fn lasso() -> ElasticNetParams<F>
pub fn lasso() -> ElasticNetParams<F>
Create a LASSO only model
Trait Implementations§
source§impl<F: Clone> Clone for ElasticNet<F>
impl<F: Clone> Clone for ElasticNet<F>
source§fn clone(&self) -> ElasticNet<F>
fn clone(&self) -> ElasticNet<F>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more