MLInterfaces (version 1.50.0)

fs.absT: support for feature selection in cross-validation

Description

support for feature selection in cross-validation

Usage

fs.absT(N) fs.probT(p) fs.topVariance(p)

Arguments

N
number of features to retain; features are ordered by descending value of abs(two-sample t stat.), and the top N are used.
p
cumulative probability (in (0,1)) in the distribution of absolute t statistics above which we retain features

Value

a function is returned, that will itself return a formula consisting of the selected features for application of MLearn.

Details

This function returns a function that will be used as a parameter to xvalSpec in applications of MLearn.

See Also

MLearn

Examples

Run this code
library("MASS")
data(crabs)
# we will demonstrate this procedure with the crabs data.
# first, create the closure to pick 3 features
demFS = fs.absT(3)
# run it on the entire dataset with features excluding sex
demFS(sp~.-sex, crabs)
# emulate cross-validation by excluding last 50 records
demFS(sp~.-sex, crabs[1:150,])
# emulate cross-validation by excluding first 50 records -- different features retained
demFS(sp~.-sex, crabs[51:200,])

Run the code above in your browser using DataCamp Workspace