mdl_glmnet function

Wrapper for glmnet::glmnet().

Wrapper for glmnet::glmnet().

Simple wrapper for glmnet::glmnet() and glmnet::cv.glmnet().

mdl_glmnet(y, X, cv = TRUE, ...)

Arguments

  • y: The outcome variable.
  • X: The (sparse) feature matrix.
  • cv: Boolean to indicate use of lasso with cross-validated penalty.
  • ...: Additional arguments passed to glmnet. See glmnet::glmnet() and glmnet::cv.glmnet() for a complete list of arguments.

Returns

mdl_glmnet returns an object of S3 class mdl_glmnet as a simple mask of the return object of glmnet::glmnet() or glmnet::cv.glmnet().

Examples

glmnet_fit <- mdl_glmnet(rnorm(100), matrix(rnorm(1000), 100, 10)) class(glmnet_fit)

References

Friedman J, Hastie T, Tibshirani R (2010). "Regularization Paths for Generalized Linear Models via Coordinate Descent." Journal of Statistical Software, 33(1), 1–22.

Simon N, Friedman J, Hastie T, Tibshirani R (2011). "Regularization Paths for Cox's Proportional Hazards Model via Coordinate Descent." Journal of Statistical Software, 39(5), 1–13.

See Also

glmnet::glmnet(),glmnet::cv.glmnet()

Other ml_wrapper: mdl_glm(), mdl_ranger(), mdl_xgboost(), ols()