topepo / caret

caret (Classification And Regression Training) R package that contains misc functions for training and plotting classification and regression models
http://topepo.github.io/caret/index.html
1.62k stars 632 forks source link

print method for LOO #435

Closed topepo closed 8 years ago

topepo commented 8 years ago
> tt <- train(Species ~ ., data = iris, method = "lda", trControl = trainControl(method = "LOOCV"))
Loading required package: MASS
> tt
Linear Discriminant Analysis 

150 samples
  4 predictor
  3 classes: 'setosa', 'versicolor', 'virginica' 

No pre-processing
Resampling: Leave-One-Out Cross-Validation 
Summary of sample sizes: 149, 149, 149, 149, 149, 149, ... 
Resampling results:

> 
claczny commented 8 years ago

I get a different behaviour , i.e., an error, when using rf instead of lda:

> tt <- train(Species ~ ., data = iris, method = "rf", trControl = trainControl(method = "LOOCV"))
> tt
Random Forest 

150 samples
  4 predictor
  3 classes: 'setosa', 'versicolor', 'virginica' 

No pre-processing
Resampling: Leave-One-Out Cross-Validation 
Summary of sample sizes: 149, 149, 149, 149, 149, 149, ... 
Resampling results across tuning parameters:

Error in `[.data.frame`(tuneAcc, , params, drop = FALSE) : 
  undefined columns selected

Thank you very much for looking into this.

Best,

Cedric

[EDIT]

packageVersion("caret") [1] ‘6.0.68’

rsangole commented 7 years ago

I'm facing this exact issue on 'rf' today. Has this issue been fixed already, or did I uncover a new bug?