Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using snow: do wrappers really need to be added to the SuperLearner namespace? #150

Open
rdiaz02 opened this issue Feb 14, 2024 · 0 comments

Comments

@rdiaz02
Copy link

rdiaz02 commented Feb 14, 2024

The documentation (e.g., p. 55 in the current https://cran.r-project.org/web/packages/SuperLearner/SuperLearner.pdf ; the Examples section of the help for SuperLearner) says

snow example with user-generated wrappers
If you write your own wrappers and are using snowSuperLearner()
These new wrappers need to be added to the SuperLearner namespace and exported to the clusters
Using a simple example here, but can define any new SuperLearner wrapper
my.SL.wrapper <- function(...) SL.glm(...)
assign function into SuperLearner namespace
environment(my.SL.wrapper) <-asNamespace("SuperLearner")

However, as far as I can tell, adding the wrappers to the namespace is not necessary (exporting them to the cluster is necessary).
I did not read this thoroughly the first time, and I've been using SuperLearner with snow clusters and my custom wrappers without adding them to the namespace; I actually do not understand why it would be necessary to add them to the namespace so I am hesitant to do it. What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant