Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set.seed(12)
- train_control <- trainControl(method="cv", number=5,savePredictions = TRUE)
- rfmodel <- train(Species~., data=iris, trControl=train_control, method="rf")
- first_holdout <- subset(rfmodel$pred, Resample == "Fold1")
- str(first_holdout)
- 'data.frame': 90 obs. of 5 variables:
- $ pred : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1
- $ obs : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1
- $ rowIndex: int 2 3 9 11 25 29 35 36 41 50 ...
- $ mtry : num 2 2 2 2 2 2 2 2 2 2 ...
- $ Resample: chr "Fold1" "Fold1" "Fold1" "Fold1" ...
Add Comment
Please, Sign In to add comment