Learn R Programming

emil (version 1.1-6)

emil.fit.glmnet: Fit GLM with LASSO, Ridge or elastic net regularization.

Description

Fits generalized linear models with regularization using the glmnet package implementation.

Usage

emil.fit.glmnet(x, y, family, nfolds, foldid, alpha = 1, lambda = NULL, ...)

Arguments

x
Dataset.
y
Response vector. Can be of many different types for solving different problems, see glmnet.
family
Determines the the type of problem to solve. Auto detected if y is numeric or survival. See family for details.
nfolds
foldid
alpha
Regularization parameter, see glmnet.
lambda
Regularization parameter, see glmnet.
...
Sent to cv.glmnet.

Value

  • Fitted GLM.

Details

The alpha parameter of glmnet controls the type of penalty. Use 0 (default) for lasso only, 1 for ridge only, or an intermediate for a combination. This is typically the variable to tune on. The shrinkage, controlled by the lambda parameter, can be left unspecified for internal tuning (works the same way as emil.fit.glmnet).

See Also

emil, emil.predict.glmnet, modeling.procedure