ecpolley / SuperLearner

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

Not a bug but a prerequisite requirement of package (ranger) #130

Closed ambisnail closed 4 years ago

ambisnail commented 4 years ago

when I ran the following chunk: sl = SuperLearner(Y = y_train, X = x_train, family = binomial(), SL.library = c("SL.mean", "SL.glmnet", "SL.ranger"))

I got error:

Failed with error: ‘there is no package called ‘ranger’’ Error : loading required package (ranger) failed Error in algorithm SL.ranger The Algorithm will be removed from the Super Learner (i.e. given weight 0)

It is because I did not install a package ranger. It took me a while to figure it out SL.ranger needs a package called ranger.

ecpolley commented 4 years ago

That is correct, the package 'ranger' is required to be installed to be able to use the 'SL.ranger' wrapper. Most of the wrappers included have package requirements (e.g. the 'SL.glmnet' requires the 'glmnet' package)