I used mice
to create some multiply imputed datasets:
library(glmnetUtils)
library(mice)
nhanes <- mice::nhanes
imp <- mice(nhanes)
com <- complete(imp, "long")
Using glmnetUtils
, it is possible to cross-validate for both alpha and lambda simultaneously:
nhanes$hyp <- factor(nhanes$hyp)
fit <- cva.glmnet(hyp ~ ., data = nhanes, alpha = seq(0, 1, 0.05), family = "binomial")
Questions:
- How could I run repeated cross-validation using
glmnetUtils
? - How can I parallelise the process? My real training dataset has 71,200 observations and takes approximately four hours to complete one run of cross-validation.
To do parallel computation, you just need to follow the glmnetUtils manual. In your case, you can do something like the following.