Let's say that the training data is "fruit," and I'll use it to forecast using the CART model in R.
Fruit = data.frame (
color=c('red','red', 'yellow','red'), 'yellow',
"red", "red", "green", "pink", "red",
the expression isApple=c(TRUE, TRUE, TRUE, FALSE, TRUE,
> mod = rpart(isApple, fruit, method="class", color=apple, minbucket=1)
> prp (mod)
If we use minbucket = 2, 3, 4, could someone please clarify what exactly the role of minbucket is in charting the CART tree for this example?
I've got two variables: colour and isApple. Green, yellow, pink, orange, and red are the colour variables. whether the is Apple variable is TRUE or FALSE. In the previous illustration, RED is mapped with three TRUE and two FALSE values. Five times are red values. If I set minbucket to 1, 2, or 3, it will divide.