Ferran Casarramona
2013-Jun-11 14:31 UTC
[R] Caret train with glmnet give me Error "arguments imply differing number of rows"
Hello, I'm training a set of data with Caret package using an elastic net (glmnet). Most of the time train works ok, but when the data set grows in size I get the following error: Error en { : task 1 failed - "arguments imply differing number of rows: 9, 10" and several warnings like this one: 1: In eval(expr, envir, enclos) : model fit failed for Resample01 My call to train function is like this: fit <- train(TrainingPreCols, TrainingFrame[,PCol], method="glmnet", preProcess = c("center","scale")) When TrainingPreCols is 17420 obs. of 27 variables, the function works ok. But with a size of 47000 obs of 27 variables I get the former error. ¿Could be the amount of data the cause of this error? Any help is appreciated, Ferran P.D.: This is my sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 [4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] glmnet_1.9-3 Matrix_1.0-12 doSNOW_1.0.7 iterators_1.0.6 snowfall_1.84-4 [6] snow_0.3-12 caret_5.16-04 reshape2_1.2.2 plyr_1.8 lattice_0.20-6 [11] cluster_1.14.4 foreach_1.4.1 loaded via a namespace (and not attached): [1] codetools_0.2-8 grid_2.15.0 stringr_0.6.2 tools_2.15.0 [[alternative HTML version deleted]]
Mxkuhn
2013-Jun-11 21:43 UTC
[R] Caret train with glmnet give me Error "arguments imply differing number of rows"
The data size isn't an issue. Can you send a reproducible example? Max On Jun 11, 2013, at 10:31 AM, Ferran Casarramona <ferran.casarramona at gmail.com> wrote:> Hello, > > I'm training a set of data with Caret package using an elastic net (glmnet). > Most of the time train works ok, but when the data set grows in size I get > the following error: > Error en { : > task 1 failed - "arguments imply differing number of rows: 9, 10" > > and several warnings like this one: > 1: In eval(expr, envir, enclos) : > model fit failed for Resample01 > > My call to train function is like this: > fit <- train(TrainingPreCols, TrainingFrame[,PCol], method="glmnet", > preProcess = c("center","scale")) > > When TrainingPreCols is 17420 obs. of 27 variables, the function works ok. > But with a size of 47000 obs of 27 variables I get the former error. > > ?Could be the amount of data the cause of this error? > > Any help is appreciated, > Ferran > > P.D.: > This is my sessionInfo() > R version 2.15.0 (2012-03-30) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 > LC_MONETARY=Spanish_Spain.1252 > [4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] glmnet_1.9-3 Matrix_1.0-12 doSNOW_1.0.7 iterators_1.0.6 > snowfall_1.84-4 > [6] snow_0.3-12 caret_5.16-04 reshape2_1.2.2 plyr_1.8 > lattice_0.20-6 > [11] cluster_1.14.4 foreach_1.4.1 > > loaded via a namespace (and not attached): > [1] codetools_0.2-8 grid_2.15.0 stringr_0.6.2 tools_2.15.0 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.