1
votes

I want to do feature selection of my random forrest model following the approach of rfe of the caret package. As my data set contains only about 100 labeled samples and as it is highly unbalanced (which reflects real life balance), I need/want to do stratified cross validation. However, I did not find any documentation about the rfeControl function regarding stratified cross validation.

Does anybody know if the rfeControl function does create stratified folds if I use

ctrl <- rfeControl(functions = rfFuncs,
               method = "cv",
               verbose = FALSE)
1

1 Answers

2
votes

with method ="cv", rfe() should use createFolds() to create your folds, and these will be balanced based on your output variable. You can see ?createFolds for details on how this is implemented.