Closed JiayiJi closed 2 years ago
With the current version, this is expected behavior. The SuperLearner
function references a number of functions, so even if you are using your own candidate algorithm functions (e.g. the All()
is an included variable screening function) and your own method function for the meta learner, the code still uses exported functions for the cross-validation creation.
For future reference, user can get around this supplying env = environment(SuperLearner::SuperLearner)
in the call to SuperLearner()
. Maybe this should be the default option, with the parent.frame()
searched next if the supplied learner is not found there.
I was trying to run the example code from the help page for the SuperLearner function and it seems that the SuperLearner function could only run after I've attached the package in the global environment using library(SuperLearner). I tried calling the SuperLearner function directly using SuperLearner::SuperLearner(). However, an error pops up. The following is my code to reproduce the error (The code is from the Examples in ?SuperLearner).
The error message was
The following is my R version.