Solved – Error with caret, using “out-of-bag” re-sampling

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

library(caret) data(iris) 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.

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:

trainControl()

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.

Similar Posts:

Rate this post

Leave a Comment