cv.glmnet fails for ridge, not lasso, for simulated data with coder error
Gist The error: Error in predmat[which, seq(nlami)] = preds : replacement has length zero The context: data is simulated with a binary y, but there are n coders of true y . the data is stacked n times and a model is fitted, trying to get true y . The error is received for L2 penalty, but not L1 penalty. when Y is the coder Y, but not when it is the true Y. the error is not deterministic, but depends on seed. UPDATE: the error is for versions after 1.9-8. 1.9-8 does not fail. Reproduction base data: library(glmnet) rm(list=ls()) set.seed(123) num_obs=4000 n_coders=2 precision=.8 X <- matrix