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.
Best Answer
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:
- Solved – how to perform classification using function train in caret in R
- Solved – Optimal parameters with resampling in random forest
- Solved – Multiclass Summary Metrics in R’s Caret when predicting Probabilities
- Solved – Multiclass Summary Metrics in R’s Caret when predicting Probabilities
- Solved – way to disable the parameter tuning (grid) feature in CARET