Guest User

Untitled

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