Re: [R] How to get lasso fit coefficient(given penalty tuning parameter \lambda) using lars package
I have this problem as well Could you please kindly let me know what s is please. Is s equals to the value of lambda? Many thanks Lini -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-lasso-fit-coefficient-given-penalty-tuning-parameter-lambda-using-lars-package-tp3073831p4637042.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to get lasso fit coefficient(given penalty tuning parameter \lambda) using lars package
Oh, I just realize that I can actually just use this: beta = coef(lassofit, s=5, mode="lambda") Michael On Sun, Dec 5, 2010 at 8:10 PM, michael wrote: > Hi, all, > > I am using the lars package for lasso estimate. So I get a lasso > fit first: > > lassofit = lars(x,y,type ="lasso",normalize=T, intercept=T) > Then I want to get coefficient with respect to a certain value of \lambda > (the tuning parameter), I know lars has three mode options c("step", > "fraction", "norm"), but can I use the \lambda value instead of the norm > which is the L1 norm of coefficients? > > Thanks, > > Michael > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] How to get lasso fit coefficient(given penalty tuning parameter \lambda) using lars package
Hi, all, I am using the lars package for lasso estimate. So I get a lasso fit first: lassofit = lars(x,y,type ="lasso",normalize=T, intercept=T) Then I want to get coefficient with respect to a certain value of \lambda (the tuning parameter), I know lars has three mode options c("step", "fraction", "norm"), but can I use the \lambda value instead of the norm which is the L1 norm of coefficients? Thanks, Michael [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.