Lasso with no intercept
Show older comments
Hi all, I want to use the lasso function in the statistics toolbox but with no intercept. Kind of forcing the \beta_0 to be zero. Is there an easy way to do that ? Cheers, Ahmed
Answers (5)
Dani Klein
on 11 May 2020
1 vote
I was having the same problem, and as Yu Bai mentioned, the official documentation
B = lasso(X,y,'Lambda',lambda,'Intercept',false).
It occured to me that the documentation of MATLAB R2019b did not say this. Therefore, I thought that it might be new in the 2020a version and I was right. I updated the software, implemented it, and it works. So you should consider the update.
Thomas Barrios
on 17 Aug 2014
0 votes
I want to know the answer to this as well.
Rafa Valero
on 17 Oct 2015
0 votes
Any answers? Please
Qiang ZHU
on 16 Jan 2019
0 votes
same here
Yu Bai
on 11 May 2020
0 votes
It is a bit strange as official documentation of lasso contains an "Intercept" option but actually it is not implemented.
Categories
Find more on Linear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!