Functions to Simplify the Use of 'glmnet' for Machine Learning
Assign observations to folds in a balanced way
Conduct cross-validation
Convert a data.frame into a matrix ready for glmnet
Obtain and use a glmnet prediction model
Get the relevance of the model items
Get the main glmnet model across imputations and folds
Impute missing variables in a glmnet matrix multiple times
Convert a "Surv" object into binary variables at different time points
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) <doi:10.1038/s41537-022-00309-w>, Palau et al. (2023) <doi:10.1016/j.rpsm.2023.01.001>, Sobregrau et al. (2024) <doi:10.1016/j.jpsychores.2024.111656>.