When I train just using glm
, everything works, and I don\'t even come close to exhausting memory. But when I run train(..., method=\'glm\')
, I run
I think the above answers are a bit outdated. The caret and caretEnsemble packages now include an additional parameter in trainControl 'trim.' Trim is initially set to FALSE but changing it to TRUE will significantly decrease model size. You should use this in combination with returnData=FALSE for the smallest model sizes possible. If you're using a model ensemble, you should also specify these two parameters in the greedy/stack ensemble trainControl.
For my case, a 1.6gb model shrunk to ~500mb with both parameters in the ensemble control and further shrunk to ~300mb also using the parameters in the greedy ensemble control.
Ensemble_control_A9 <- trainControl(trim=TRUE, method = "repeatedcv", number = 3, repeats = 2, verboseIter = TRUE, returnData = FALSE, returnResamp = "all", classProbs = TRUE, summaryFunction = twoClassSummary, savePredictions = TRUE, allowParallel = TRUE, sampling = "up")
Ensemble_greedy_A5 <- caretEnsemble(Ensemble_list_A5, metric="ROC", trControl=trainControl(number=2, trim=TRUE, returnData = FALSE, summaryFunction=twoClassSummary, classProbs=TRUE))