rfe

R Caret's rfe [Error in { : task 1 failed - “rfe is expecting 184 importance values but only has 2”]

怎甘沉沦 提交于 2019-12-04 12:57:09
I am using Caret's rfe for a regression application. My data (in data.table ) has 176 predictors (including 49 factor predictors). When I run the function, I get this error: Error in { : task 1 failed - "rfe is expecting 176 importance values but only has 2" Then, I used model.matrix( ~ . - 1, data = as.data.frame(train_model_sell_single_bid)) to convert the factor predictors to dummy variables. However, I got similar error: Error in { : task 1 failed - "rfe is expecting 184 importance values but only has 2" I'm using R version 3.1.1 on Windows 7 (64-bit), Caret version 6.0-41. I also have

R rfe function “caret” Package error: there should be the same number of samples in x and y

ぐ巨炮叔叔 提交于 2019-12-04 04:16:56
问题 As I'm trying the rfe example from the "caret" package taken from here, I kept on receiving this error Error in rfe.default(d[1:2901, ], c(1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, : there should be the same number of samples in x and y This question has been asked but its solution doesn't apply in this case. Here's the code: set.seed(7) # load the library library(mlbench) library(caret) # load the data d <- read.table("d.dat") # define the control using a random forest selection function control <

Feature Selection in caret rfe + sum with ROC

ぃ、小莉子 提交于 2019-12-03 14:02:55
问题 I have been trying to apply recursive feature selection using caret package. What I need is that ref uses the AUC as performance measure. After googling for a month I cannot get the process working. Here is the code I have used: library(caret) library(doMC) registerDoMC(cores = 4) data(mdrr) subsets <- c(1:10) ctrl <- rfeControl(functions=caretFuncs, method = "cv", repeats =5, number = 10, returnResamp="final", verbose = TRUE) trainctrl <- trainControl(classProbs= TRUE) caretFuncs$summary <-

Feature Selection in caret rfe + sum with ROC

亡梦爱人 提交于 2019-12-03 03:19:49
I have been trying to apply recursive feature selection using caret package. What I need is that ref uses the AUC as performance measure. After googling for a month I cannot get the process working. Here is the code I have used: library(caret) library(doMC) registerDoMC(cores = 4) data(mdrr) subsets <- c(1:10) ctrl <- rfeControl(functions=caretFuncs, method = "cv", repeats =5, number = 10, returnResamp="final", verbose = TRUE) trainctrl <- trainControl(classProbs= TRUE) caretFuncs$summary <- twoClassSummary set.seed(326) rf.profileROC.Radial <- rfe(mdrrDescr, mdrrClass, sizes=subsets,

R rfe function “caret” Package error: there should be the same number of samples in x and y

孤者浪人 提交于 2019-12-01 21:26:20
As I'm trying the rfe example from the "caret" package taken from here , I kept on receiving this error Error in rfe.default(d[1:2901, ], c(1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, : there should be the same number of samples in x and y This question has been asked but its solution doesn't apply in this case. Here's the code: set.seed(7) # load the library library(mlbench) library(caret) # load the data d <- read.table("d.dat") # define the control using a random forest selection function control <- rfeControl(functions=rfFuncs, method="cv", number=10) # run the RFE algorithm results <- rfe(d[1