Convenience wrapper for LASSO regression (L1 regularization) using glmnet
with cross-validation. Equivalent to run_glmnet with alpha = 1.
Usage
run_lasso(X, y, family = gaussian(), standardize = TRUE, nfolds = 10)Arguments
- X
Design matrix of predictors (n × p).
- y
Response vector or survival object.
- family
Response family. Can be gaussian(), binomial(), poisson(), Gamma(), or "cox" for Cox regression.
- standardize
Logical. Should variables be standardized? Default TRUE.
- nfolds
Number of cross-validation folds. Default 10.
Details
LASSO (Least Absolute Shrinkage and Selection Operator) performs both regularization and variable selection by setting some coefficients to exactly zero. This function provides a convenient interface specifically for LASSO regression.