我有數據,其中觀測數n小於變量數p。答案變量是二進制的。例如: n <- 10
p <- 100
x <- matrix(rnorm(n*p), ncol = p)
y <- rbinom(n, size = 1, prob = 0.5)
我想,以適應物流模型,這個數據。所以 model <- glmnet(x, y, family = "binomial", intercept = F
glmnet圖例標籤錯誤,我從這個職位(Adding labels on curves in glmnet plot in R)修改函數傳說添加到情節如下: library(glmnet)
fit = glmnet(as.matrix(mtcars[-1]), mtcars[,1])
lbs_fun <- function(fit, ...) {
L <- length(fit$