A) Write a python program to choose the first root node for a regression tree using the CART algorithm as explained in class from the following dataset: B) Do the calculation in Excel to verify that your program has indeed chosen the best attribute according to the SDR metric. show your work. I only need help with part B # hours to bike (Numeric) Temperature Humidity Wind Weather Speed Condition Cool High Breezy Sunny 13 Warm Moderate Gentle Sunny 12 Cold High Windy Rainy 20 Mild High Calm Cloudy 9 Hot Moderate Strong Rainy 23 Warm High Moderate Cloudy 5 Very Cold Very Light Rainy 6 High Mild High Breezy Sunny 3 Cool High Windy Sunny 10 Mild Very Light Cloudy 3 High
Added by Anthony A.
Close
Step 1
To calculate the SDR, we need to calculate the standard deviation of the target variable (hours to bike) for each possible value of each attribute. For the Temperature attribute: - For the value "Cool", the target variable values are [10]. The standard deviation Show more…
Show all steps
Your feedback will help us improve your experience
Adi S and 57 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
(a) Describe two potential advantages of regression trees over other statistical learning methods. (b) When growing a regression tree using CART, two types of splits are considered. Describe these splits and provide an example for each. (c) A regression tree has three types of nodes: the root node, internal nodes and terminal nodes. Describe each node and explain how predictions are made using a regression tree. (d) Large bushy regression trees tend to over-fit the training data. Briefly explain what is meant by over-fitting and under-fitting the training data using regression trees. (e) The predictive performance of a single regression tree can be substantially improved by aggregating many decision trees. i. Briefly explain the method of bagging regression trees. ii. Explain the difference between bagging and random forest. iii. Briefly explain two differences between boosted regression trees and random forest.
Adi S.
a. Develop a regression relationship using Excel’s Data Analysis package, using year and number of tourists as independent variables. What is the regression equation? # of tourist= 0.402+0.044 b.What is expected ridership if 10 million tourists visit the city in year 13? c. Explain the predicted ridership if there are no tourists at all in year 13. d. What are the model’s correlation coefficient and coefficient of determination? Interpret and discuss these values
David N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD