简体   繁体   English

套索回归的R中的标准化系数

[英]Standardized coefficients in R for lasso regression

Is there a way to get a list of the standardized coefficients for lasso regression in R? 是否有一种方法可以获取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. 我需要完全相同的模型-即,相同的系数必须看起来非零-但在缩放数据上运行套索回归时,用于非缩放数据的lambda毫无意义。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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