Question
You will be using Boston data set to predict per capita crime rate using the other variables in this data set. 1. To begin, load
You will be using Boston data set to predict per capita crime rate using the other variables in this data set.
1. To begin, load in the Boston data set. The Boston data set is part of the ISLR2 library. > library(ISLR2) Read about the data set: > ?Boston Make 4-5 plots (pairwise scatterplots, boxplots, and histograms) of the variables in this data set. Describe your findings for each plot.
2. We will be using validation set method of cross validation. Randomly split the data into two groups, 80% for training and 20% for testing.
3. Fit a multiple regression model to the training set to predict per capita crime rate using all of the predictors. a. Describe your model (i.e., meaning of some values. Draw a residual plot.) b. What is its performance on training set (i.e., training MSE and R^2)?
c. For which predictors can we reject the null hypothesis H0: j = 0? d. What is the prediction performance on the test set (test MSE)?
4. Fit two models (best subset selection and the lasso) to the training set to predict per capita crime rate. a. Describe your model (i.e., what variables are left in the model. Draw some plots) b. What are their performance on training set (i.e., training MSE)?
c. What are the prediction performances on the test set (test MSE)?
5. Apply smoothing spline to one or more predictors. Fit a model to the training set to predict per capita crime rate using gam(). a. Describe your model results (i.e., how each predictor impacts the target variable. Draw some plots.) b. What is its performance on training set (i.e., training MSE)? c. What is the prediction performance on the test set (test MSE)?
6. Which of the above models seem to perform well on this data set? Justify your answer.
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