public class ElasticNet
extends java.lang.Object
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.
| Constructor and Description |
|---|
ElasticNet() |
| Modifier and Type | Method and Description |
|---|---|
static LinearModel |
fit(smile.data.formula.Formula formula,
smile.data.DataFrame data,
double lambda1,
double lambda2)
Fit an Elastic Net model.
|
static LinearModel |
fit(smile.data.formula.Formula formula,
smile.data.DataFrame data,
double lambda1,
double lambda2,
double tol,
int maxIter)
Fit an Elastic Net model.
|
static LinearModel |
fit(smile.data.formula.Formula formula,
smile.data.DataFrame data,
java.util.Properties prop)
Fit an Elastic Net model.
|
public static LinearModel fit(smile.data.formula.Formula formula, smile.data.DataFrame data, java.util.Properties prop)
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.prop - Training algorithm hyper-parameters and properties.public static LinearModel fit(smile.data.formula.Formula formula, smile.data.DataFrame data, double lambda1, double lambda2)
prop include
lambda1 is the shrinkage/regularization parameter for L1
lambda2 is the shrinkage/regularization parameter for L2
tolerance is the tolerance for stopping iterations (relative target duality gap).
max.iterations is the maximum number of IPM (Newton) iterations.
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 shrinkage/regularization parameter for L1lambda2 - the shrinkage/regularization parameter for L2public static LinearModel fit(smile.data.formula.Formula formula, smile.data.DataFrame data, double lambda1, double lambda2, double tol, int maxIter)
prop include
lambda1 is the shrinkage/regularization parameter for L1
lambda2 is the shrinkage/regularization parameter for L2
tolerance is the tolerance for stopping iterations (relative target duality gap).
max.iterations is the maximum number of IPM (Newton) iterations.
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 shrinkage/regularization parameter for L1lambda2 - the shrinkage/regularization parameter for L2tol - the tolerance for stopping iterations (relative target duality gap).maxIter - the maximum number of IPM (Newton) iterations.