[R] [R-pkgs] Package glmnetUtils now on CRAN

Hong Ooi via R-packages r-packages at r-project.org
Wed Apr 26 12:14:17 CEST 2017

I'm pleased to announce that the glmnetUtils package is now available on CRAN. I wrote this after using the popular glmnet package to fit elastic net models for a few customer projects, and rewriting the same boilerplate code each time.

glmnetUtils provides some quality-of-life improvements for glmnet, specifically:

- a formula/data frame interface to glmnet and cv.glmnet. No more manual fiddling around with model.matrix/as.matrix/data.matrix, worrying about NA values, etc.
- a cva.glmnet function to choose both the alpha and lambda parameters via cross-validation, following the approach described in the help page for cv.glmnet. Optionally does the cross-validation in parallel.
- Methods for predict and coef for the above.

In addition, to facilitate analysis of very wide datasets, glmnetUtils by default takes a slightly different approach to generating model matrices. Rather than calling model.frame() and model.matrix() on the full dataset, it builds up the model.matrix term by term. This is because model.frame() creates a terms object, which can be excessively large for wide data. Building up the model matrix one term at a time avoids this problem.

CRAN link: https://cran.r-project.org/package=glmnetUtils

Github repo: https://github.com/hong-revo/glmnetUtils

Please feel free to contact me with suggestions, bug reports, criticisms, etc.

R-packages mailing list
R-packages at r-project.org

More information about the R-help mailing list