Ridge Regression and the Lasso with the Hitters Data
I have recorded a series of coding videos on regularized regression (these are technically from a past semester, so keep that in mind if I say anything not current). They follow a modified version of the chapter 6 coding notebook in ‘ISLP’. I have cut the parts on forward, backward, and subset selection and on dimensionality reduction, and I have added more on ‘RidgeCV’ and ‘LassoCV’, which you will want for your homework. The dataset is the ‘Hitters’ dataset, which we introduced back in the ‘statsmodels’ vignette in week 3. We go through first how to use general cross-validation to select the best value of the regularization parameter, then we show how to estimate the out of sample accuracy and the uncertainty in it, and we also look at nested cross-validation.
There will be an additional Lasso Vignette (exceeded my Youtube upload limit for the day) shortly.
The code for these can be found in the following jupyter notebooks: regularization-hitters.ipynb or regularization-hitters-live.ipynb