I think I have figured out the problem. The response variable has one level with only one observation -- hence when that one observation was in the test set the training data did not contain any observations from that level and so did not fit a logistic model for that level causing the somewhat cryptic error message.
-- View this message in context: http://r.789695.n4.nabble.com/glmnet-strange-error-message-tp2240458p2241566.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.