Providing a reproducible example and the results of `sessionInfo` will help get your question answered.
Also, what is the point of using glmnet with RFE? It already does feature selection. On Wed, Dec 23, 2015 at 1:48 AM, Manish MAHESHWARI <mani...@dbs.com> wrote: > Hi, > > I am trying to use caret, for feature selection on glmnet. I get a strange > error like below - "arguments imply differing number of rows: 2, 3". > > > x <- data.matrix(train[,features]) > > y <- train$quoteconversion_flag > > > > > str(x) > > num [1:260753, 1:297] NA NA NA NA NA NA NA NA NA NA ... > > - attr(*, "dimnames")=List of 2 > > ..$ : NULL > > ..$ : chr [1:297] "original_quote_date" "field6" "field7" "field8" ... > > > str(y) > > Factor w/ 2 levels "X0","X1": 1 1 1 1 1 1 1 1 1 1 ... > > > RFE <- rfe(x,y,sizes = seq(50,300,by=10), > + metric = "ROC",maximize=TRUE,rfeControl = MyRFEcontrol, > + method='glmnet', > + tuneGrid = expand.grid(.alpha=0,.lambda=c(0.01,0.02)), > + trControl = MyTrainControl) > +(rfe) fit Resample01 size: 297 > +(rfe) fit Resample02 size: 297 > +(rfe) fit Resample03 size: 297 > +(rfe) fit Resample04 size: 297 > +(rfe) fit Resample05 size: 297 > +(rfe) fit Resample06 size: 297 > +(rfe) fit Resample07 size: 297 > +(rfe) fit Resample08 size: 297 > +(rfe) fit Resample09 size: 297 > +(rfe) fit Resample10 size: 297 > +(rfe) fit Resample11 size: 297 > +(rfe) fit Resample12 size: 297 > +(rfe) fit Resample13 size: 297 > +(rfe) fit Resample14 size: 297 > +(rfe) fit Resample15 size: 297 > +(rfe) fit Resample16 size: 297 > +(rfe) fit Resample17 size: 297 > +(rfe) fit Resample18 size: 297 > +(rfe) fit Resample19 size: 297 > +(rfe) fit Resample20 size: 297 > +(rfe) fit Resample21 size: 297 > +(rfe) fit Resample22 size: 297 > +(rfe) fit Resample23 size: 297 > +(rfe) fit Resample24 size: 297 > +(rfe) fit Resample25 size: 297 > Error in { : > task 1 failed - "task 1 failed - "arguments imply differing number of > rows: 2, 3"" > In addition: There were 50 or more warnings (use warnings() to see the > first 50) > > Any idea what does this mean? > > Thanks, > Manish > > CONFIDENTIAL NOTE: > The information contained in this email is intended on...{{dropped:13}} ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.