Learn R Programming

gencve (version 0.3)

featureSelect: Feature Select For Wide Data

Description

A commonly used method with microarrays to select the best genes for class prediction is implemented. This method involves computing the one-way anova for each gene and select the genes with the between classes sum of squares or equivalently the largest F-ratios.

Usage

featureSelect(X, y, numFeatures = 10)

Arguments

X
data matrix
y
must be a factor with length equal to the number of rows of X
numFeatures
the number of features to be selected - usually larger than the default 10.

Value

the column indicies corresponding to the columns of X that are selected

References

tba

Examples

Run this code
Xy <- churnTrain
y <- Xy[, ncol(Xy)]
Xy <- Xy[, -ncol(Xy)]
X <- as.matrix.data.frame(Xy[,-(1:5)])
(ind <- featureSelect(X, y, numFeatures=5))
colnames(X)[ind]

Run the code above in your browser using DataLab