Question
In this exercise we will predict the number of applications received using the other variables in the College data set. Please use R code for
In this exercise we will predict the number of applications received using the other variables in the College data set.
Please use R code for answers!
a. split the data set into training set and test set
b. use 5-fold cross-validation using the entire data set to estimate the test error in in addition to the test setapproach.
c. Fit a ridge regression model on the training set, with lambda chosen by cross-validation. Report the test error obtained
d. Fit a lasso model on the training set, with lambda chosen by cross-validation. Report the test error obtained, along with the number of non-zero coefficients obtained.
e.Fit a PCR model on the training set, with M chosen by cross-validation. Report the test error obtained, along with the value of M selected by cross-validation.
f. Fit a PLS model on the training set, with M chosen by cross-validation.Report the test error obtained, along with the value of M selected by cross-validation.
g. Comment on the result obtained. How accurately can we predict the number of colleges applications received? Is there much of difference among the test errors resulting from these five appproaches?
In order to get the College data set you must do the following in the RStudio
require(ISLR)
require(caret)
data('College')
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