Learn R Programming

specmine (version 3.1.6)

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
  library(caret)
  library(specmine.datasets)
  data(cachexia)
  rfe.result = filter_feature_selection(cachexia$data, 
	       cachexia$metadata$Muscle.loss, functions = caret::rfSBF, 
	       method = "cv")
# }

Run the code above in your browser using DataLab