简体   繁体   中英

Standardized coefficients in R for lasso regression

Is there a way to get a list of the standardized coefficients for lasso regression in R? Following cross validation, I have identified the optimal lambda and can then obtain the coefficients appropriate for unscaled data using the predict function. I need the exact same model - ie the same coefficients must appear to be non-zero - but the lambda used for the unscaled data makes little sense when running lasso regression on scaled data.

这将为您提供来自弹性网的给定s的缩放系数(将lambda设置为0以关闭L2损失):

predict( model, newx=xmat, s=s, mode="fraction", type="coefficients" )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM