I'm new to R and RStudio and have been experimenting with predictive modeling. The following train function works without parallel processing but when I implement doSNOW makeCluster, I get the error shown below related to a variable named "optimismBoot". I've searched in vain for a resolution, tried installing and uninstalling packages, but nothing works. Any insight appreciated.
cl <- makeCluster(2, type = "SOCK")
registerDoSNOW(cl)
caret.cv <- train(ReturnedToMF ~ .,
data = trees.cetstrain,
method = "xgbTree",
tuneGrid = tune.grid,
trControl = cetstrain.control)
Error in e$fun(obj, substitute(ex), parent.frame(), e$data) :
unable to find variable "optimismBoot"
I found the following link on this site but it doesn't really provide a solution to make parallel processing work: Caret on R spills "unable to find variable "optimismBoot"" error message
There is a reference to this issue on Caret github page. They seem to have fixed it lately
See here : https://github.com/topepo/caret/issues/706
In that case, I guess installing caret directly from github should solve the problem .
devtools::install_github('topepo/caret/pkg/caret')
See here : https://github.com/topepo/caret
Follow these steps: (I'm assuming you are using RStudio)
devtools
package as usual devtools::install_github('topepo/caret/pkg/caret')
and check the output to make sure the package is refreshed from githubcaret:::nominalTrainWorkflow
and make sure the following line is in there : export <- c("optimism_xy")
. If you do it right now, the line would have optimismBoot
instead of optimism_xy
PS: Latest version of Caret is dated September 7, 2017. So updating should solve the issue as well.
I was facing this problem when I updated the packages the new caret version is caret_6.0-77, now I solve it by download the old version of caret package is caret_6.0-76 from the cran archives packages see this link Click here!, and then install the package file locally using Rstudio from the Tools menu and then select install packages it appear dialog box from the pop-menu choose to install from file (.extension)
I hope this helpful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With