Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upError when using rerank = TRUE in rfeControl using rfFuncs #942
Comments
|
Also, the However, there are two bugs in Using the default > library(caret)
> library(dplyr)
>
> x <- data %>%
+ select(-var16) %>%
+ as.matrix()
>
> y <- data %>%
+ pull(var16)
>
> ctrl <- rfeControl(functions = rfFuncs,
+ method = "repeatedcv",
+ repeats = 2,
+ number = 3,
+ rerank = TRUE, #recalculate importance after each round
+ returnResamp = "final",
+ verbose = FALSE)
>
> subsets <- c(1:7, 10)
>
> rfProfile <-
+ rfe(x, y, sizes = subsets, rfeControl = ctrl)
> rfProfile
Recursive feature selection
Outer resampling method: Cross-Validated (3 fold, repeated 2 times)
Resampling performance over subset size:
Variables RMSE Rsquared MAE RMSESD RsquaredSD MAESD Selected
1 0.8213 0.1164 0.6636 0.1767 0.07516 0.1297
2 0.7961 0.1069 0.6268 0.2012 0.09828 0.1360
3 0.7362 0.1472 0.5741 0.1583 0.12812 0.1120
4 0.7152 0.1564 0.5494 0.1531 0.13126 0.1252
5 0.6932 0.1937 0.5224 0.1611 0.16194 0.1171
6 0.6876 0.2089 0.5227 0.1764 0.17427 0.1319
7 0.6871 0.1891 0.5229 0.1523 0.14117 0.1062
10 0.6961 0.1703 0.5326 0.1476 0.13660 0.1117
15 0.6852 0.1815 0.5150 0.1470 0.14243 0.1093 *
The top 5 variables (out of 15):
var11, var4, var7, var1, var12
I'm patching a number of bugs in the next day so you might want to wait a day or so before reinstalling. |
Hi,
I want to use rerank = TRUE in rfeControl.
Therefore, in rfFuncs$fit I set importance = TRUE.
At the end, I get:
Error in { : task 1 failed - "replacement has 1 row, data has 0"
It looks like here: #543
but I could not solve the problem using help provided there.
Any ideas? Thank you!
Minimal dataset:
Minimal, runnable code:
Session Info: