Homework 5 in DSCI445: Statistical Machine Learning @ CSU
Explain how \(k\)-fold cross-validation is implemented.
What are the advantages and disadvantages of \(k\)-fold cross-validation relative to
In Ch. 4, we used logistic regression to predict the probability
of default using income and
balance on the Default data set. We will now
estimate the test error of this logistic regression model using the
validation set approach.
Fit a logistic regression model that uses income and
balance to predict default.
Using the validation set approach, estimate the test error of this model. In order to do this, you must perform the following steps:
default status for each
individual in the validation set.Repeat the process in b. using 3 different splits of the observations into training and validation sets. Comment on the results obtained.
Now consider logistic regression model that predicts the
probability of default using income, balance,
and a dummy variable for student. Estimate the test error
for this model using the validation set approach. Comment on whether or
not including student leads to a reduction in the test
error rate.
We will now perform cross-validation on a simulated data set.
Generate a simulated data set as follows
x <- rnorm(100)
y <- x - 2*x^2 + rnorm(100)
df <- data.frame(x = x, y = y)
In this data set, what is \(n\) and \(p\)? Write out the model used to generate the data in equation form.
Create a scatterplot of \(X\) against \(Y\). Commend on what you see.
Compute the 10-fold CV errors that result from fitting the following four models using least squares:
Which of the models in c. had the smallest 10-fold CV error? Is this what you expected? Explain your answer.
Comment on the statistical significance of the coefficient estimates that results from fitting each of the models in c. using least squares. Do these results agree with your conclusions drawn based on the cross-validation results?
Turn in in a pdf of your homework to canvas using the provided Rmd file as a template. Your Rmd file on the server will also be used in grading, so be sure they are identical.
Be sure to share your server project with the instructor and grader. You only need to do this once per semester.
Open your homeworks project on
liberator.stat.colostate.edu
Click the drop down on the project (top right side) > Share Project…
Click the drop down and add “dsci445instructors” to your project.
This is how you receive points for reproducibility on your homework!