On 08/11/2011 01:01 PM, Andra Isan wrote:
Hi All,
I am trying to run cv.glmnet(x,y,family="multinomial", nfolds =4) and I only 
have 8 observations and the number of features I have is 1000, so my x matrix is 8 by 
1000 and when I run the following, I get this error, I am not sure what is causing this 
problem.
Error in predmat[which, , seq(nlami)] = preds :   number of items to replace is 
not a multiple of replacement length
Can it be because the number of observations is small?
Thanks a lot,Andra
        [[alternative HTML version deleted]]


1) My guess is that you do not have an observation in each class in each fold. It would be rather difficult to estimate the probability of belonging to a class without any data.

2) Do you really hope to obtain a meaningful fit for a multinomial model with only 8 observations? How many classes do you have?

--
Patrick Breheny
Assistant Professor
Department of Biostatistics
Department of Statistics
University of Kentucky

______________________________________________
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.

Reply via email to