Description Usage Arguments Examples
This function performes Recursive Feature Elimination (RFE) based on the implementation in the caret package. It is currently only implemented for classification problems. The best subset of variables is selected through maximizing the F1 score. The RFE process is performed by applying bootstrap sampling.
1 2 |
df |
A a data frame |
target |
Target variable |
subsets |
Provide a vector of the number of variables to fit models to. Defaults to c(4, 8, 16, 24, 32) |
number |
Number of repeats of the RFE process. Defaults to 25 |
ntree |
Number of random forest trees to fit. Defaults to 500 |
downsample |
Should the majority class be downsampled during resampling? Defaults to "yes" |
1 2 3 4 5 6 7 | data <- recipes::credit_data %>%
first_to_lower() %>%
apply_recipe(status) %>%
prep(retain = TRUE) %>%
juice()
rfe <- apply_rfe(data, status, number = 10, subsets = c(5, 10, 15))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.