Week 46 (November 12)
- Exercises 16.1, 18.16
- Exam 2023: Problems 3, 4, 5, 6
Week 45 (November 5)
- Exercises 10.1, 10.2, 10.4, 10.8, 15.1, 15.4
Week 44 (October 29)
- Exercise 11.2
- Exam 2021: Problem 6
- Exam 2020:Problem 4
- Exam 2018: Problem 2
Week 43 (October 22)
- Exercise 8.4
- Exercises 11.3, 11.4
- Exam 2018: Problems 3
Week 42 (October 15)
- Exercise 9.1 (Hint: Show that \(S\hat y=\hat y\) )
- Apply a single classification tree and bagging to the spam data and contrast the results of the two algorithms
- You can use the spam_tree_bagging.r script for this, but look at the details in order to understand how both fitting of tree and bagging is performed.
- Rcode bagging
- Exercise 9.6 (but in b one fit trees)
- Data are available from the textbook webpage
- Look at the spam_gam.r on how to fit a gam model.
- Rcode 9.6
- Exercise 1 from the STK-IN4300 second mandatory assignment of 2018
Week 41 (October 8)
- Exercises 5.1, 5.3, 5.4, 5.7, 5.9
- Sol: 5.1_5.7_5.9 , 5.4 , Rcode5.3
Week 40 (October 1)
- starting from Table 3.3: (i) include lasso as well; (ii) add 3 columns to Table 3.3 with the results for SCAD, adaptive lasso and elastic-net (using prostate data);
- Hint: The glmnet function has an option penalty.factor. The ncvreg package has a routine called ncvreg with an option penalty="SCAD"
- Check 3.17 Rcode on week 38
- Hint: The glmnet function has an option penalty.factor. The ncvreg package has a routine called ncvreg with an option penalty="SCAD"
- Exercises 6.2 and 6.3
- Sol 6.2_6.3
- Exam 2021: Problem 1
- Exam 2020: Problem 3
Week 39 (September 24)
Week 38 (September 17)
- Exercises 3.6, 3.16, 3.19 (not the question about PLS), 7.7, 7.9
- Starting from exercise 3.17: (i) include lasso as well; (ii) add 4 columns to Table 3.3 with the results for non-negative garrote, SCAD, adaptive lasso and elastic-net (using prostate data); (iii) repeat exercise 3.17 using logistic (penalized) regression for (weighted) LS, best subset, lasso and ridge regression;
- For this part, you can use the script ex_3_7_logistic.r.
- Rcode_3.17(extended)
Week 37 (September 10)
- Pen-and-paper: 3.3(a),7.1, 7.4, 7.5 and 7.6
- extra exercise (here the R code to download the data)
Week 35 (August 27-28)
- This week, both Tuesday and Wednesday are used for exercises. The Tuesday exercises are mainly for those that not have taken STK2100 earlier (but can be a good repetition for everyone).
- On Tuesday, exercises 1 , 2, 4 from the STK2100 exercise set.
- On Wednesday: