Question: Using R and the model file regressiontree.r , predict the individuals' credit scores using an individual regression tree. Use 1 0 0 % of the

Using R and the model file regressiontree.r, predict the individuals' credit scores using an individual regression tree. Use 100% of the data for training and validation and set aside no data as a test set. Be sure to exclude the index variable Individual from your analysis. (Set the random number seed to 2002.)
(a)
Train a full regression tree using a 10-fold cross-validation experiment.
Hint: The full regression tree can be constructed by setting the complexity parameter cp to zero by inserting the following commands into the regressiontree.r file. Make sure to insert these commands directly before the command that trains the regTreeFit model. Run the entire script when answering this part and part (b).
grid <- expand.grid(.cp =0)
regTreeFull <- train(CreditScore ~ .- Individual, data = training, method = "rpart", trControl = ctrl, tuneGrid = grid)
regTreeFull
Report the RMSE from the full regression tree. (Round your answer to three decimal places.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!