Guest User

Untitled

a guest
Jun 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. ctrl = rpart.control(maxdepth=6)
  2. dt_model <- rpart(formula, data, method='class',control=ctrl)
  3.  
  4. # this doesn't work
  5. fit <- rpart(class ~ ., data = df, method = "class", control = ("maxdepth = 1"))
  6.  
  7. # changing maxdepth here effects your tree depth.
  8. rpart(class ~ ., data = df, method = "class", control = list(maxdepth = 1))
Add Comment
Please, Sign In to add comment