Learn R Programming

SQDA (version 1.0)

sQDA: Spase Quadratic Discriminant Analysis

Description

Spase Quadratic Discriminant Analysis

Usage

sQDA(train.data = NULL, test.data = NULL, len = 100, lams = seq(0.02, 1, length = 10), presel = T, prelam = 0.2, margin = 0.05)

Arguments

train.data
data matrix with column names being the class labels and row names being the genes.
test.data
the new data needs to be predicted.
len
block size
lams
a sequence of lambda's from cross-validation.
presel
pre-selection indicator.
prelam
pre-selection sparisty parameter, only used when presel=T.
margin
error margin for pre-selection, only used when presel=T.

Value

returns a list object with following items.
pred
predictions for class labels on the test.data
p
the number of blocks selected

References

The application of sparse estimation of covariance matrix to quadratic discriminant analysis. Jiehuan Sun and Hongyu Zhao.

Examples

Run this code
data(exampledata)
res<-sQDA(train.data[1:100,],test.data[1:100,],lams=0.2,presel=FALSE)
sum(res$pred!=colnames(test.data))/ncol(test.data)  ##prediction error
res$p ## number of blocks selected
res$pred ## predicted class labels on test.data

Run the code above in your browser using DataLab