Question
All variables identified as categorical or binary in the codebook should be converted to factor variables. Split the sample into training (60%) and test (40%)
All variables identified as categorical or binary in the codebook should be converted to factor variables. Split the sample into training (60%) and test (40%) sets with the seed set at 500. Exclude OBS. and CREDIT_EXTENDED from the data set. For classification problems, create the outcome variable (PROFITABLE=1 if NPV>0, =0 otherwise), and convert it into a factor variable. , you will be building both classification models (consider PROFITABLE as dependent variable) and regression models (Consider NPV as dependent variable). For classification problems (predicting PROFITABLE), DO NOT use NPV in the model. For regression problems (predicting NPV), DO NOT use PROFITABLE in the model. Build a Regression Tree model to predict the NPV. What is the training RMSE of the (unpruned) tree? Note : Do not consider the PROFITABLE variable for analysis. What is the best value for the pruned tree? Attach an image of the best pruned tree. Before making a call to the cv.tree function set the seed value to 500. What is the difference in test RMSE of the unpruned and pruned tree for the best value? What is the decision tree considering the first 30 observations. Suppose you use this tree to extend credit to customers in the test data set based on the rule that a loan is only made to those individuals with predicted NPV>0. What would the total profits be?
Build a linear regression model to predict NPV using the same independent variables used above. Now, following the same rule as in the question above, what is the total profit you would make in the test data set?
What is the total profit if you lend money to everyone in the test data set?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started