Learn R Programming

specmine (version 1.0)

filter_feature_selection: Perform selection by filter

Description

Perform selection by filter using univariate filters, from caret's package.

Usage

filter_feature_selection(datamat, samples.class, functions = caret::rfSBF, method = "cv", repeats = 5)

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 filtering.
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.

Value

A caret's sbf object with the result of selection by filter.

Examples

Run this code
## Not run: 
#   ## Example of selection by filter
#   data(cachexia)
#   library(caret)
#   rfe.result = filter_feature_selection(cachexia$data, 
# 	       cachexia$metadata$Muscle.loss, functions = caret::rfSBF, 
# 	       method = "cv")
# ## End(Not run)

Run the code above in your browser using DataLab