Understanding of minbucket function in CART model using R

0 votes
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,
FALSE,FALSE,FALSE,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.
Jul 20, 2022 in Data Science by avinash
• 1,840 points
590 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Data Science

0 votes
1 answer

How to implement Knn-algorithm without using k-nn function in r?

I created an example that demonstrates the ...READ MORE

answered Jun 24, 2022 in Data Science by Sohail
• 3,040 points
469 views
0 votes
1 answer

How To Create Vector of Vector In R

Create a list: List() on x returns x[[1]] ...READ MORE

answered Jun 24, 2022 in Data Science by Sohail
• 3,040 points
489 views
0 votes
1 answer

Add two lines on graph using abline in R

I am using "y 0+x" to fit ...READ MORE

answered Jun 24, 2022 in Data Science by Sohail
• 3,040 points
603 views
0 votes
1 answer

rnorm function in R - Usage

y = rnorm(12, rep(c(1,2,1), each=4, 0.2)) I can ...READ MORE

answered Jun 24, 2022 in Data Science by Sohail
• 3,040 points
670 views
0 votes
1 answer

Problem with sample function in R

The first time works, but after that, ...READ MORE

answered Jun 24, 2022 in Data Science by Sohail
• 3,040 points
497 views
0 votes
1 answer

grepl in R to find matches to any of a list of character strings

Inside of a grepl regular expression, you ...READ MORE

answered Jun 24, 2022 in Data Science by Sohail
• 3,040 points
3,222 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
1,043 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
1,211 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
5,905 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,142 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP