我正在训练一个 Elastic Net 模型,发现它lambda.1se
远高于lambda.min
,通常是在选择零特征的情况下测试的最大 lambda。我猜这是因为我的标准偏差真的很大。
有没有办法在和cv.glmnet
之间选择一个值?lambda.1se
lambda.min
x = matrix(rnorm(100 * 20), 100, 20) # not the actual data
y = gl(2, 50)
fit <- cv.glmnet(
x = x, y = y,
family = "binomial",
nfolds = nrow(x), grouped = F,
standardize = T,
alpha = 0.2
)