Learn R Programming

specmine (version 1.0)

feature_selection: Perform feature selection

Description

Perform feature selection on the dataset.

Usage

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

Run this code
## Not run: 
#   ## Example of feature selection using rfe and sbf
#   data(cachexia)
#   library(caret)
#   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")
# ## End(Not run)

Run the code above in your browser using DataLab