Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(4 points) Bias-variance tradeoff for polynomial regression with squared error loss and L2 regularization. This problem is designed based on Example 4.3 in LWLS. It
(4 points) Bias-variance tradeoff for polynomial regression with squared error loss and L2 regularization. This problem is designed based on Example 4.3 in LWLS. It will guide you to reproduce Figure 4.10 to better understand bias-variance tradeoff as you tighten/loosen regularization. a. ( 0.5 points) Generate 1000 data points (x,y) using the formula y=5 2x+x3+, where N(0,1), i.e., standard normal distribution, and xU[0,1], i.e., uniform distribution between 0 and 1 . This will be your test set, which will be fixed throughout this problem. b. Generate another 10 data points using the same formula in a). This will be your training set to fit. c. ( 0.5 points) Fit your training set with 4th order polynomial using linear regression with squared error loss and L2 regularization. In other words, the prediction y^=wT(x), where (x)=[1,x,x2,x3,x4]T. N1y(X)w22+w22 Set =0.1, and solve w. Compute and report the mean-squared-error (MSE) on the training set and the test set. They are your Etrain and an estimate of Enew, respectively, for this particular and particular training set. Note: you may use your polynomial regression implementation in HW3 or an external package to solve w. d. (1 point) Repeat b) and c) 20 times with the same . Compute the average MSE on the training sets and test sets. They are your estimates for Etrain and Enew for the particular , respectively. Note: The "underscores" in variables and equations in d) and e) should really be "bars". This typo was likely due to some compatibility issues between Word and GoogleDoc, or between Windows and Macos during the development of this assignment. e. (1 point) Also compute the bias 2 (second term), variance (first term) and irreducible error (third term) components of Enew using the following formula Eutew=E[ET[(y^(x;T)f(x))2]]+E[(f(x)f0(x))2]+2 f. (1 point) Repeat d) with different values of from 0.001 to 10 and reproduce the curves in Figure 4.10 of LWLs. Describe your observations of this figure. As you vary , when does underfitting happen and when does overfitting happen
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