recursive_feature_elimination: Perform recursive feature elimination

Description Usage Arguments Value Examples

View source: R/feature_selection.R

Description

Perform recursive feature elimination on the dataset using caret's package.

Usage

1
2
3
recursive_feature_elimination(datamat, samples.class, 
functions = caret::rfFuncs, method = "cv", repeats = 5, 
number = 10, subsets = 2^(2:4))

Arguments

datamat

data matrix from dataset.

samples.class

string or index indicating what metadata to use.

functions

a list of functions for model fitting, prediction and variable importance.

method

the external resampling method: boot, cv, LOOCV or LGOCV (for repeated training/test splits.

repeats

for repeated k-fold cross-validation only: the number of complete sets of folds to compute.

number

either the number of folds or number of resampling iterations.

subsets

a numeric vector of integers corresponding to the number of features that should be retained.

Value

A caret's rfe object with the result of recursive feature selection.

Examples

1
2
3
4
5
6
7
  ## Example of recursive feature elimination
  library(specmine.datasets)
  data(cachexia)
  library(caret)
  rfe.result = recursive_feature_elimination(cachexia$data, 
	       cachexia$metadata$Muscle.loss, functions = caret::rfFuncs, 
	       method = "cv", number = 3, subsets = 2^(1:6))

specmine documentation built on Sept. 21, 2021, 5:06 p.m.