feature_selection: Perform feature selection

Description Usage Arguments Value Examples

View source: R/feature_selection.R

Description

Perform feature selection on the dataset.

Usage

1
2
3
feature_selection(dataset, column.class, method = "rfe", 
functions, validation = "cv", repeats = 5, number = 10, 
subsets = 2^(2:4))

Arguments

dataset

list representing the dataset from a metabolomics experiment.

column.class

string or index indicating what metadata to use.

method

method used for feature selection. Possible values are "rfe" (recursive feature elimination) and "filter" (Selection by filter - sbf) from caret's package.

functions

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

validation

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 (rfe only).

Value

caret's result from rfe or sbf.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## Example of feature selection using rfe and sbf
  library(caret)
  library(specmine.datasets)
  data(cachexia)
  rfe.result = feature_selection(cachexia, "Muscle.loss", 
               method="rfe", functions = caret::rfFuncs, 
               validation = "cv", number = 3, 
               subsets = 2^(1:6))
  sbf.result = feature_selection(cachexia, "Muscle.loss", 
	       method="filter", functions = caret::rfSBF, 
	       validation = "cv")

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