Customization of recursive feature elimination to do resampling inside rfFuncs

Dear community,

I have been fighting with the customization of rfFuncs. There has been a topic about that, however the provided code here does not work:

I have changed the rfFuncs$fit, which works outside rfe:
rf_fit <- function(x, y, first, last, ...){

df_up <- caret::upSample(x, y)

df_up[ , names(df_up) != "Class"],
importance = TRUE,

However I get following error message when inserting in the rfe formula:
Error in { : task 1 failed - "argument is of length zero"

Can anybody help me??

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.