Question: Predicting Delayed Flights. The file FlightDelays.csv contains information on all commercial flights departing the Washington, DC area and arriving at New York during January 2
Predicting Delayed Flights. The file FlightDelays.csv contains information on all commercial flights departing the Washington, DC area and arriving at New York during January For each flight, there is information on the departure and arrival airports, the distance of the route, the scheduled time and date of the flight, and soon. The variable that we are trying to predict is whether or not a flight is delayed. Adelay is defined as an arrival that is at least minutes later than scheduled. Data Preprocessing. Transform variable day of week DAYWEEK info a categorical variable. Bin the scheduled departure time into eight bins. Use these and all other columns as predictors excluding DAYOFMONTH Partition the data into training and validation sets.
a Fit a classification tree to the flight delay variable using all the relevant predictors. Do not include DEPTIME actual departure time in the model because it is unknown at the time of prediction unless we are generating our predictions of delays after the plane takes off, which is unlikely Use a tree with a maximum depth of and minimum impurity decrease Express the resulting tree as a set of rules.
SOLUTION
b If you needed to fly between DCA and EWR on a Monday at : AM would yoube able to use this tree? What other information would you need? Is it available inpractice? What information is redundant?
c Fit the same tree as in a this time excluding the Weather predictor. Display boththe resulting small tree and the fullgrown tree. You will find that the small treecontains a single terminal node.
i How is the small tree used for classification? What is the rule for classifying?
ii To what is this rule equivalent?
iii. Examine the fullgrown tree. What are the top three predictors according to
this tree?
iv Why, technically, does the small tree result in a single node?
v What is the disadvantage of using the top levels of the fullgrown tree as opposed
to the small tree?
vi Compare this general result to that from logistic regression in the example in
Chapter What are possible reasons for the classification trees failure to find
a good predictive model?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
