Learn R Programming

mt (version 2.0-1.20)

get.fs.len: Get Length of Feature Subset for Validation

Description

Get feature lengths for feature selection validation by classification.

Usage

get.fs.len(p,fs.len=c("power2"))

Value

An descending order numeric vector of feature lengths.

Arguments

p

Number of features in the data set.

fs.len

Method or numeric sequence for feature lengths. It can be a numeric vector as user-defined feature lengths, or methods:

  • full. The feature lengths are p, ..., 2, 1. This is an exhaustive method. If p is too large, it will consume a lot of time and hence it is not practical.

  • half. The feature lengths are the sequence of p, p/2, p/2/2, ..., 1.

  • power2. The feature lengths are the sequence of p, 2^(log2(p)-1), ..., 2^1, 2^0.

Author

Wanchang Lin

Details

The generation of feature length is used in the validation of feature subsets by classification. The feature length decide the lengths of feature subset starting from top of the full feature order list.

See Also

fs.rfe, frank.err, frankvali

Examples

Run this code

data(abr1)
dat <- abr1$pos

## number of featres
p <- ncol(dat)

## predefined feature lengths. The returned will be descending order 
## vector with the first one is p.
(vec <- get.fs.len(p, fs.len=c(1,2,3,4,5,6,7,8,9,10)))

## use all features as feature lengths
(vec.full <- get.fs.len(p, fs.len="full"))

## use "half"
(vec.half <- get.fs.len(p, fs.len="half"))

## use "power2"
(vec.power2 <- get.fs.len(p, fs.len="power2"))

Run the code above in your browser using DataLab