[R] Caret - Recursive Feature Elimination Error
Manish MAHESHWARI
manishm at dbs.com
Wed Dec 23 07:48:11 CET 2015
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 only...{{dropped:11}}
More information about the R-help
mailing list