2

I have been testing caret on R to test neural network features. As I run the script below, it was working correctly, this has been starting outputting "unable to find variable "optimismBoot".

library(doParallel)
cl <- makePSOCKcluster(4)
registerDoParallel(cl)
library(caret)
m<-rbind(c(1,2,3),c(4,5,6),c(7,8,9))
train_data<-as.data.frame(m)
nnmodel <- train(
  V3 ~ ., 
  data = train_data,
  method = "nnet", 
  preProcess = c('center', 'scale'),
  trControl = trainControl(method = "cv"),
  tuneGrid = expand.grid(size=c(1:10), decay=seq(0.1, 1, 0.1)),
  linout = T
)

Why?

[environment]
Windows 10 64bit
R 3.4.1
RStudio
jmuhlenkamp
  • 2,102
  • 1
  • 14
  • 37
tensor5375
  • 126
  • 1
  • 9

2 Answers2

4

This issue is a caret defect that was repaired in the September 11, 2017 release of caret. Install the github version of caret with devtools::install_github('topepo/caret/pkg/caret').

See issue #706 on the caret github site for details.

regards,

Len

Len Greski
  • 10,505
  • 2
  • 22
  • 33
1

I did not get this problem resolved by reverting to R version 3.3.3. Also, my other computer has R 3.4.0 installed which has no problem with caret. Strange voodoo... ... Update: The problem could involve the package snow. Switching off parallelization (unloading the doParallel package) resolved the problem for me.

RobW
  • 125
  • 7
  • I think so too. By restarting RStudio, I've resolved problem. It seems a problem of loaded libraries. thank you. – tensor5375 Sep 13 '17 at 10:40