recursive_feature_elimination: Recursive Feature Elimination

Description Usage Arguments Details Author(s) Examples

Description

This function performs an recursive feature elimination using the rfe function from caret package. This implentation of RFE uses parallel processing

Usage

1
2
3
4
recursive_feature_elimination(df, sizes = c(2:5, 10), index = NULL,
  nfolds = 5, repeats = 1, fun = caret::rfFuncs, method_rfe = NULL,
  cpu_cores = 6, metric = ifelse(is.factor(df[, 1]), "Kappa",
  "Rsquared"), seeds = NULL, verbose = TRUE)

Arguments

df

dataframe, with income variable in the first column

sizes

A numeric vector of integers corresponding to the number of features that should be retained. Default = c(2:5,10)

index

Users cross validation folds. Default = NULL

nfolds

Number of folds to be build in cross-validation. Default = 10

repeats

repeats

fun

Default = rfFuncs , get importance values from Random Forest model.

method_rfe

regression/classificiatio method to be used when fun = caretFuncs

cpu_cores

Number of CPU cores to be used in parallel processing. Default = 6. For avoid parallel execution set this parameter to zero.

metric

metric used to evaluate model fit. For numeric outcome possible values are ("RMSE", "Rsquared) and for categorical outcome ("Accuracy","Kappa")

seeds

seeds

verbose

print results and execution time of function

Details

This function implements backwards selection of predictors based on predictor importance ranking. The predictors are ranked and the less important ones are sequentially eliminated prior to modeling. The goal is to find a subset of predictors that can be used to produce an accurate model. The web page http://topepo.github.io/caret/recursive-feature-elimination.html#rfe has more details and examples related to this function.

details

Author(s)

RFE by Max Kuhn

Elpidio Filho, elpidio@ufv.br

Examples

1
2
3
4
## Not run: 
rfe(df,sizes = c(2:10,12,15,20), cpu_cores = 4)

## End(Not run)

elpidiofilho/labgeo documentation built on May 14, 2019, 9:35 a.m.