2019-01-31[Stay Sharp]Lasso Regression and Ridge Regression

Loss function with L2 Regularization:
\min _ { w } \sum _ { i = 1 } ^ { m } \left( y _ { i } - \boldsymbol { w } ^ { \mathrm { T } } \boldsymbol { x } _ { i } \right) ^ { 2 } + \lambda \| \boldsymbol { w } \| _ { 2 } ^ { 2 }
the model use L2 Regularization is called Ridge Regression

Loss function with L1 Regularization:

\min _ { \boldsymbol { w } } \sum _ { i = 1 } ^ { m } \left( y _ { i } - \boldsymbol { w } ^ { \mathrm { T } } \boldsymbol { x } _ { i } \right) ^ { 2 } + \lambda \| \boldsymbol { w } \| _ { 1 }
the model use L2 Regularization is called Lasso Regression

For Lasso Regression and Ridge Regression, if is zero, then the Loss function will get back to ordinary least square function, and if is very large, the model will under-fit.
the main difference between Lasso Regression and Ridge Regression is that Lasso will remove some less important feature by shrinking its coefficient to zero. which is useful for dataset with a huge number of features.

你可能感兴趣的:(2019-01-31[Stay Sharp]Lasso Regression and Ridge Regression)