Class ElasticNet
java.lang.Object
smile.regression.ElasticNet
Elastic Net regularization. The elastic net is a regularized regression
method that linearly combines the L1 and L2 penalties of the lasso and ridge
methods.
The elastic net problem can be reduced to a lasso problem on modified data and response. And note that the penalty function of Elastic Net is strictly convex so there is a unique global minimum, even if input data matrix is not full rank.
References
- Kevin P. Murphy: Machine Learning A Probabilistic Perspective, Section 13.5.3, 2012
- Zou, Hui, Hastie, Trevor: Regularization and Variable Selection via the Elastic Net, 2005
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordElastic Net hyperparameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic LinearModelFits an Elastic Net model.static LinearModelfit(Formula formula, DataFrame data, ElasticNet.Options options) Fits an Elastic Net model.
-
Method Details
-
fit
Fits an Elastic Net model.- Parameters:
formula- a symbolic description of the model to be fitted.data- the data frame of the explanatory and response variables. NO NEED to include a constant column of 1s for bias.lambda1- the L1 shrinkage/regularization parameterlambda2- the L2 shrinkage/regularization parameter- Returns:
- the model.
-
fit
Fits an Elastic Net model.- Parameters:
formula- a symbolic description of the model to be fitted.data- the data frame of the explanatory and response variables. NO NEED to include a constant column of 1s for bias.options- the hyperparameters.- Returns:
- the model.
-