1 / 6

Recitation 1 April 9

Recitation 1 April 9. Polynomial regression Ridge regression Lasso. Polynomial regression. lm( y ~ poly(x, degree = d ) , data =dataset) Find the optimal degree Check the residual plots Training and test set Cross-validation R demo 1. Ridge regression – R package.

max
Télécharger la présentation

Recitation 1 April 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recitation 1April 9 Polynomial regression Ridge regression Lasso

  2. Polynomial regression • lm( y ~ poly(x, degree = d), data=dataset) • Find the optimal degree • Check the residual plots • Training and test set • Cross-validation • R demo 1

  3. Ridge regression – R package • lm.ridge() in library(“MASS”) • lm.ridge( y ~ . , data = dataset, lambda = seq(0, 0.01, by=0.001) ) • R demo 2

  4. Ridge regression – from sketch • Ridge regression estimators have closed form solutions: • How to deal with intercept? • Tuning parameter: • Effective degrees of freedom • Implement: HW 2

  5. Lasso – R package • l1ce() in library(“lasso2”) or lars() in library(“lars”) • l1ce( y ~ . , data = dataset, bound = shrinkage.factor) • Lasso doesn’t have EDF (why?) . We can use the shrinkage factor to get a sense of the penalty. • R demo 3

  6. Lasso – from sketch • Shooting algorithm (stochastic gradient descent) • At each iteration, randomly sample one dimension j, and update • How to deal with intercept • Center x and y • Standardize x • Tuning parameter • Shrinkage factor for a given • Convergence criterion • Implement: HW 2 Bonus problem

More Related