Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uptimingSamps error using formula interface #420
Comments
|
It was related to the assumption that the predictors would be in a data frame. It works now... Thanks, Max > library("caret")
Loading required package: lattice
Loading required package: ggplot2
Need help? Try the ggplot2 mailing list:
http://groups.google.com/group/ggplot2.
>
> data(kyphosis, package = "rpart")
>
> fitControl <- trainControl(method = "cv",
+ timingSamps = 5)
> train(Kyphosis ~ ., data = kyphosis,
+ method = "rpart",
+ trControl = fitControl)
Loading required package: rpart
CART
81 samples
3 predictor
2 classes: 'absent', 'present'
No pre-processing
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 73, 74, 72, 72, 73, 74, ...
Resampling results across tuning parameters:
cp Accuracy Kappa
0.00000000 0.8244048 0.41896846
0.01960784 0.8244048 0.41896846
0.17647059 0.7535714 0.04381318
Accuracy was used to select the optimal model using the largest value.
The final value used for the model was cp = 0.01960784.
> # Error in eval(expr, envir, enclos) : object 'Age' not found
>
> # Using non-formula interface works
> train(x = kyphosis[, -1], y = kyphosis$Kyphosis,
+ method = "rpart",
+ trControl = fitControl)
CART
81 samples
3 predictor
2 classes: 'absent', 'present'
No pre-processing
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 73, 73, 73, 73, 73, 72, ...
Resampling results across tuning parameters:
cp Accuracy Kappa
0.00000000 0.7940476 0.3621554
0.01960784 0.7940476 0.3621554
0.17647059 0.7690476 0.1507268
Accuracy was used to select the optimal model using the largest value.
The final value used for the model was cp = 0.01960784. |
Hi Max,
I think I have found a bug. I followed your instructions:
update.packages(oldPkgs="caret", ask=FALSE)sessionInfo()Minimal dataset:
Minimal, runnable code:
Session Info:
Thank you very much for your great package!!