码迷,mamicode.com
首页 > 其他好文 > 详细

L1范式和L2范式的区别

时间:2015-08-25 18:32:52      阅读:589      评论:0      收藏:0      [点我收藏+]

标签:

L1 and L2 regularization add a cost to high valued weights to prevent overfitting. L1 regularization is an absolute value cost function and tends to set more weights to 0 (places more mass on zero weights) compared to L2 regularization.

 


Difference between L1 and L2
 L2 (Ridge) shrinks all the coefficient by the same proportions but eliminates none, while L1 (Lasso) can shrink some coefficients to zero, performing variable selection.

Which to use
If all the features are correlated with the label, ridge outperforms lasso, as the coefficients are never zero in ridge. If only a subset of features are correlated with the label, lasso outperforms ridge as in lasso model some coefficient can be shrunken to zero.

 

 

reference:http://www.quora.com/What-is-the-difference-between-L1-and-L2-regularization

L1范式和L2范式的区别

标签:

原文地址:http://www.cnblogs.com/lysuns/p/4757777.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!