Introduction to Statistical Learning - Final Examination
Chapters 5, 6, 7, 8, and 10
```{css, echo=FALSE} .pagedjs_page { padding: 1in; }
h1 { color: #2C3E50; border-bottom: 2px solid #3498DB; padding-bottom: 10px; }
h2 { color: #34495E; margin-top: 20px; }
.mcq-question { margin-bottom: 20px; page-break-inside: avoid; }
.short-question { margin-bottom: 30px; page-break-inside: avoid; background-color: #f8f9fa; padding: 15px; border-left: 4px solid #3498DB; } ```
Instructions
Time Allowed: 180 minutes
Total Marks: 100
This examination consists of two sections:
- Section A: Multiple Choice Questions (20 questions × 3 marks = 60 marks)
- Section B: Short Questions (3 questions × variable marks = 40 marks)
Answer all questions. Show all working for Section B questions.
Section A: Multiple Choice Questions (60 marks)
Instructions: Select the best answer for each question.
Question 1. Which of the following best describes the purpose of k-fold cross-validation?
- To increase the size of the training dataset
- To estimate the test error of a statistical learning method
- To reduce the variance of predictions
- To eliminate the need for a validation set
Question 2. In the bootstrap method, approximately what fraction of observations are NOT included in a given bootstrap sample?
- 1/n
- 1/e ≈ 0.368
- 1/2
- 1/3
Question 3. The bias-variance trade-off in k-fold cross-validation suggests that:
- Larger k leads to higher bias and lower variance
- Larger k leads to lower bias and higher variance
- Larger k leads to both lower bias and lower variance
- k does not affect bias or variance
Question 4. Ridge regression addresses multicollinearity by:
- Removing highly correlated predictors
- Setting some coefficients exactly to zero
- Shrinking all coefficients toward zero
- Orthogonalizing the predictor matrix
Question 5. Which statement about Lasso regression is TRUE?
- It can only shrink coefficients, not set them to zero
- It performs variable selection by setting some coefficients to zero
- It requires all predictors to be on the same scale
- Both b and c are correct
Question 6. In ridge regression, as the tuning parameter λ increases:
- Model flexibility increases and training RSS decreases
- Model flexibility decreases and training RSS increases
- Coefficient estimates approach their least squares values
- The bias-variance trade-off does not change
Question 7. Principal Components Regression (PCR) differs from ordinary least squares by:
- Using only the first M principal components as predictors
- Performing variable selection automatically
- Requiring standardization of predictors
- Both a and c are correct
Question 8. A natural cubic spline with K knots is represented by:
- K basis functions
- K + 1 basis functions
- K + 2 basis functions
- K + 4 basis functions
Question 9. Which method would be most appropriate for modeling a non-linear relationship when you suspect different predictors have different functional forms?
- Polynomial regression
- Regression splines
- Generalized Additive Models (GAMs)
- Step functions
Question 10. A key advantage of regression splines over polynomial regression is:
- They are always more flexible
- They provide better behavior at the boundaries
- They require fewer basis functions
- They automatically select the degree of the polynomial
Question 11. In decision tree construction, which measure is NOT typically used for node splitting in classification trees?
- Gini index
- Cross-entropy
- Mean squared error
- Classification error rate
Question 12. Bagging (Bootstrap Aggregation) reduces:
- Bias only
- Variance only
- Both bias and variance equally
- Neither bias nor variance
Question 13. Random forests improve upon bagging by:
- Using a larger number of trees
- Randomly selecting a subset of predictors at each split
- Using deeper trees
- Pruning each tree more aggressively
Question 14. In boosting, each new tree is fit to:
- The original response values
- The residuals from the current model
- A bootstrap sample of the data
- A random subset of predictors
Question 15. Which tree-based method typically uses shallow trees (stumps)?
- Bagging
- Random forests
- Gradient boosting
- Single decision trees
Question 16. In a neural network, the activation function serves to:
- Initialize the weights
- Introduce non-linearity into the model
- Reduce overfitting
- Select important features
Question 17. Dropout is a regularization technique that:
- Removes less important input features
- Randomly sets a fraction of neurons to zero during training
- Reduces the number of hidden layers
- Decreases the learning rate over time
Question 18. Convolutional Neural Networks (CNNs) are particularly well-suited for:
- Time series forecasting
- Text classification
- Image recognition
- Structured tabular data
Question 19. The vanishing gradient problem in deep neural networks refers to:
- Gradients becoming too large during backpropagation
- Gradients becoming very small in early layers
- The loss function having multiple local minima
- The training data having missing values
Question 20. Recurrent Neural Networks (RNNs) differ from standard neural networks by:
- Having connections that form cycles
- Using convolutional layers
- Requiring less training data
- Being limited to binary classification
Section B: Short Questions (40 marks)
Question 1. (15 marks)
Suppose we have a dataset with n = 100 observations and p = 10 predictors. We want to compare three approaches: least squares regression, ridge regression, and lasso regression.
(5 marks) Explain conceptually why we might prefer ridge or lasso regression over least squares regression in this setting.
(5 marks) Describe a procedure to select the optimal tuning parameter λ for ridge regression using cross-validation. Include specific details about the steps involved.
(5 marks) Suppose after fitting lasso regression with the optimal λ, you find that only 4 of the 10 predictors have non-zero coefficients. How would you interpret this result? What does this tell you about the relationship between the predictors and the response?
Space for answer:
Question 2. (12 marks)
Consider fitting a generalized additive model (GAM) to predict a continuous response Y using three predictors X₁, X₂, and X₃.
(4 marks) Write down the general form of a GAM with these three predictors. Explain what each component represents.
(4 marks) Describe two advantages and one disadvantage of using a GAM compared to a standard linear regression model.
(4 marks) Suppose diagnostic plots suggest that the relationship between Y and X₁ is approximately linear, while the relationships with X₂ and X₃ are highly non-linear. How would you modify your GAM to account for this? Write the modified model.
Space for answer:
Question 3. (13 marks)
You are building a classification model to predict customer churn (binary outcome) using a dataset with 20 predictor variables. You are considering using random forests and boosting.
(5 marks) Explain the key algorithmic difference between random forests and boosting. How does each method combine the predictions from multiple trees?
(4 marks) Both methods have tuning parameters that need to be selected. For random forests, identify two key tuning parameters and explain their role. For boosting, identify two key tuning parameters and explain their role.
(4 marks) After fitting both models, you find that the random forest has a test error rate of 12% and the boosting model has a test error rate of 10%, but the boosting model takes much longer to train. Discuss the trade-offs you would consider when choosing between these two models for deployment in a production environment.
Space for answer:
Answer Key (For Instructor Use Only)
Section A - Multiple Choice Answers
- b - Cross-validation estimates test error
- b - Approximately 1/e observations are excluded
- b - Larger k → lower bias, higher variance
- c - Ridge shrinks coefficients toward zero
- d - Lasso performs variable selection and requires scaling
- b - Higher λ → less flexibility, higher training RSS
- d - PCR uses M principal components and requires standardization
- d - Natural cubic spline with K knots has K + 4 basis functions
- c - GAMs allow different forms for different predictors
- b - Splines have better boundary behavior
- c - MSE is used for regression trees, not classification
- b - Bagging reduces variance
- b - Random forests randomly select predictors at each split
- b - Boosting fits to residuals
- c - Gradient boosting typically uses shallow trees
- b - Activation functions introduce non-linearity
- b - Dropout randomly zeros neurons during training
- c - CNNs excel at image recognition
- b - Vanishing gradient means gradients become small in early layers
- a - RNNs have cyclic connections
Section B - Marking Guidelines
Question 1: - Part (a): Award marks for mentioning bias-variance trade-off, handling multicollinearity, feature selection (for lasso) - Part (b): Award marks for describing data splitting, grid of λ values, computing CV error, selecting λ with minimum error - Part (c): Award marks for discussing variable selection, model interpretability, identifying important predictors
Question 2: - Part (a): Correct GAM form: Y = β₀ + f₁(X₁) + f₂(X₂) + f₃(X₃) + ε, explanation of smooth functions - Part (b): Advantages: flexibility, interpretability; Disadvantage: additive assumption - Part (c): Modified model using linear term for X₁ and smooth functions for X₂ and X₃
Question 3: - Part (a): Random forests: parallel independent trees with averaging; Boosting: sequential trees with weighted combination - Part (b): RF: number of trees (B), mtry; Boosting: number of trees (B), learning rate (λ), tree depth (d) - Part (c): Discussion of accuracy vs. computational cost, model interpretability, maintenance, real-time requirements
END OF EXAMINATION