Learn R Programming

easy.glmnet (version 1.1)

Functions to Simplify the Use of 'glmnet' for Machine Learning

Description

Provides several functions to simplify using the 'glmnet' package: converting data frames into matrices ready for 'glmnet'; b) imputing missing variables multiple times; c) fitting and applying prediction models straightforwardly; d) assigning observations to folds in a balanced way; e) cross-validate the models; f) selecting the most representative model across imputations and folds; and g) getting the relevance of the model regressors; as described in several publications: Solanes et al. (2022) , Palau et al. (2023) , Salazar de Pablo et al. (2025) .

Copy Link

Version

Install

install.packages('easy.glmnet')

Monthly Downloads

160

Version

1.1

License

GPL-3

Maintainer

Joaquim Radua

Last Published

February 8th, 2026

Functions in easy.glmnet (1.1)

assign.folds

Assign observations to folds in a balanced way
data.frame2glmnet.matrix

Convert a data.frame into a matrix ready for glmnet
surv2binary

Convert a "Surv" object into binary variables at different time points
cv

Conduct cross-validation
glmnet_fit

Obtain and use a glmnet prediction model
impute.glmnet.matrix_fit

Impute missing variables in a glmnet matrix multiple times
glmnet_get.items.relevance

Get the relevance of the model items
glmnet_get.main.model

Get the main glmnet model across imputations and folds