ecpolley / SuperLearner

Current version of the SuperLearner R package
272 stars 72 forks source link

Return cross-validated models fits #128

Closed benkeser closed 5 years ago

benkeser commented 5 years ago

Reason for pull request

It is often useful in my research to be able to predict from cross-validated algorithm fits (i.e., the V cross-validated fits for each of the K learners). In particular, I hope to include pseudo-cross-validated standard error estimates in an update of my drtmle package.

Structure of pull request

I added an option saveCVFitLibrary to control similar to saveFitLibrary that controls whether these are returned. If they are returned it is in the cvFitLibrary entry in the output of a call to SuperLearner.

I believe I have added all relevant documentation to SuperLearner.control and SuperLearner.

I've tried to be relatively memory efficient in creating objects that hold a lot of model fits. These fits are only stored beyond the original SuperLearner code if saveCVFitLibrary = TRUE. Otherwise, this PR shouldn't be any more memory hungry than the original code.

benkeser commented 5 years ago

Just a note that the errors in the travis build appear to be related to incorrect set up of rJava rather than code introduced by this PR.