Predict the number of applications received using all other variables in the College
data set.
The dataset, available in the ISLR2 library, contains statistics for a large number of US Colleges. It has 777 observations and 18 variables.
dim(College)
[1] 777 18
College
data set. Use a seed value of 1.
Store the numeric vector with training data indices in train.idx
.Apps
as dependent variable and all other variables as independent variables.
Store the model in the variable tree.college
.cv.college
.size.cv
. which.min()
function to find the index of the tree size with the lowest value for the dev
attribute)size.cv
.
Store the model in the variable prune.college
.yhat
.mse
.Assume that: