Using the glmnet package implementation.
fit_glmnet(x, y, family, nfolds, foldid, alpha = 1, lambda = NULL, ...)fit_ridge_regression(...)
fit_lasso(...)
Dataset.
Response vector. Can be of many different types for solving
different problems, see glmnet
.
Determines the the type of problem to solve. Auto detected if
y
is numeric or survival. See family
for details.
See cv.glmnet
.
See cv.glmnet
.
Regularization parameter, see glmnet
.
Regularization parameter, see glmnet
.
Sent to fit_glmnet
or cv.glmnet
.
Fitted elastic net model.
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 parameter to tune
on. The shrinkage, controlled by the lambda
parameter, can be left
unspecified for internal tuning (works the same way as
fit_glmnet
).
Friedman J, Hastie T, Tibshirani R (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1), 1<U+2013>22. doi:10.18637/jss.v033.i01.