A simple explanation of the Lasso and Least Angle Regression

http://statweb.stanford.edu/~tibs/lasso/simple.html

http://statweb.stanford.edu/~tibs/lasso/

lasso (least absolute shrinkage and selection operator; also Lasso or LASSO)

输入: x1, x2 ...xp

输出: y

lasso要拟合下面的线性模型:

yhat=b0 + b1*x1+ b2*x2 + ... bp*xp 

同时 Minimize sum( (y-yhat)^2 ) subject to sum[absolute value(bj)] <= s

"s" is a tunIng parameter(tuning,调谐、调整),如果s被放得特别大,那么这个约束几乎就不起作用了,和普通最小二乘法没有什么分别了。

求解

lasso问题的求解可以用数值方法,但是最小角回归(least angle regression)方法更好。最小角回归看起来是逐步回归法(forward stepwise regression)的一个更加民主化的版本。

前项逐步回归

· 起初所有的bj均为0

· 找到与y最相关的xj(predictor),并加入到模型中,残差项为:r= y-yhat.

· 继续,每一阶段找到与r最相关的predictor加入到模型中

· 直到所有的predictor都在模型中

最小角回归的方法和上面说的前项逐步回归基本差不多,区别是,最小角回归doesn't add a predictor fully into the model. The coefficient of that predictor is increased only until that predictor is no longer the one most correlated with the residual r. Then some other competing predictor is invited to "join the club". 

最小角回归算法

· 起初所有的bj均为0 

· 找到与y最相关的xj(predictor)

· 增加bj的系数,沿着与y相关性的方向,与此同时计算残差residual r=y-yhat,直到有其他的predictor xk与r的相关性和xj与r的相关性一样

· 沿着最小二乘的方向增加(bj,bk),直到另一个predictor xm与残差项r相关系数更高

· Continue until: all predictors are in the model 

Surprisingly it can be shown that, with one modification, this procedure gives the entire path of lasso solutions, as s is varied from 0 to infinity. The modification needed is: if a non-zero coefficient hits zero, remove it from the active set of predictors and recompute the joint direction.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 许多项目经理在使用项目管理工具的时候都有一个误区,那就是把工具仅仅当成了汇报工作的一种途径。他们要求程序员在工具平...
    是小岸阅读 373评论 0 1
  • 进入互联网时代,让人感兴趣的应用很少是独立存在的,比如手机的日历必须与公司的日历同步,销售的系统必须有库存系统交互...
    景芝白亁阅读 816评论 1 1
  • 1、知识内化了,才是你的 让自己变得更好 芒格:要想得到某样东西,最可靠的方法是让你自己配得上它。猫叔:让自己变得...
    程意凉阅读 596评论 18 22
  • 但愿我是你的夏季,当炎热不肯退去,我愿化作风中的凉意 但愿我是你的秋季,当候鸟挥翅而去,我轻声告诉它们我爱你的讯息...
    福宁阅读 518评论 6 4