Suppose the training data is the βfruitsβ that I will use to predict using the CART model in R
> fruit=data.frame( color=c("red", "red", "red", "yellow", "red","yellow", "orange","green","pink", "red",β β"red"), isApple=c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE,FALSE,FALSE,FALSE,TRUE)) > mod = rpart(isApple ~ color, data=fruit, method="class", minbucket=1) > prp(mod)
Can someone explain what is the role of minbucket in building the CART tree for this example if we use minbucket = 2, 3, 4, 5?
I have 2 colors of variables and isApple. The color variable has green, yellow, pink, orange, and red. Apple variable is set to TRUE or FALSE. In the last example, RED has three TRUE and 2 FALSE mapped to it. The red value appears five times. if I give minbucket = 1,2,3 then it splits. If I give minbucket = 4 or 5, then no split will occur, although red appears five times.