The accompanying data set contains five predictor variables (x 1 to x 5 ) and one binary
Question:
The accompanying data set contains five predictor variables (x1 to x5) and one binary target variable (y). Follow the instructions below to create classification trees using the Exercise_10.9_Data worksheet.
a. Use the rpart function to build a default classification tree. Display the default classification tree. How many leaf nodes are in the default classification tree? What are the predictor variable and split value for the first split of the default classification tree (root node)?
b. Use the rpart function to build a fully-grown classification tree. Display the cp table. What is the cp value associated with the lowest cross-validation error? How many splits are in the minimum error tree?
c. Is there a simpler tree within one standard error of the cross-validation error of the minimum error tree? If there is, then what is the cp value associated with the best-pruned tree?
d. Use the prune function to prune the full tree to the minimum error tree. Display the minimum error tree. How many leaf nodes are in the minimum error tree?
e. Assign Class 1 to be the positive class. What are the accuracy, sensitivity, specificity, and precision of the minimum error tree on the validation data?
f. Generate the cumulative lift chart and decile-wise lift chart of the minimum error tree on the validation data. Does the entire lift curve lie above the baseline? What is the lift value of the leftmost bar of the decile-wise lift chart? What does this value imply?
g. Generate the ROC curve of the minimum error tree on the validation data. What is the area under the ROC curve (or AUC value)?
h. Score the new observations in the Exercise_10.9_Score worksheet. What is the predicted response value of the new observations? What is the Class 1 probability of the first observation? Round your answers to four decimal places.
Step by Step Answer:
Business Analytics Communicating With Numbers
ISBN: 9781260785005
1st Edition
Authors: Sanjiv Jaggia, Alison Kelly, Kevin Lertwachara, Leida Chen