When I run this code (R 2.13.2, caret 4.98 on windows 7):

TrainData <- iris[,1:4]
TrainClasses <- iris[,5]
rfFit <- train(TrainData, TrainClasses,
                 method = "rf",
                 tuneLength = 3,
                 trControl = trainControl(method = "oob"))

I get the following error:

Fitting: mtry=2 
Fitting: mtry=3 
Fitting: mtry=4 
Aggregating results
Selecting tuning parameters
Fitting model on full training set
Error in structure(list(method = method, modelType = modelType, results = performance,  : 
  object 'resampledCM' not found

What am I doing wrong?

/edit: I updated to caret 4.99 using R forge, and the problem goes away. It seems to have been unique to caret 4.98 and R 2.13.2.

  • $\begingroup$ Which version of caret are you using? (It works for me with caret v. 5.01-001, R v. 2.13.2.) $\endgroup$ – chl Oct 7 '11 at 17:50
  • $\begingroup$ @chl: I'm using caret 4.98 and R 2.13.2. I guess I have to wait until the windows version of caret on CRAN is updated. $\endgroup$ – Zach Oct 7 '11 at 19:25

I am using 4.98 and R.2.13.0 - and the code works for me as well. It looks similar to what happens when I break Caret when I forget to remove my own custom functions (I no longer modify the default for this reason). If you have checked:


and haven't found anything - that is my only suggestion.

I have broken Caret many, many times and have never seen that specific error. I have seen it with "object 'XXXXX' not found"

With XXXX being in some function I made.

  • $\begingroup$ It works for me on R 2.12.1. The problem seems to be specific to R 2.13.1 and 2.13.2. $\endgroup$ – Zach Oct 13 '11 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.