decodeLDA: Implement 'DECODE' for simple LDA

Description Usage Arguments Value References Examples

View source: R/decodeLDA.R

Description

Implement DECODE for simple LDA. The LDA assumes both classes have equal prior probabilities. This implementation is used in Hadimaja and Pun (2018).

Usage

1
decodeLDA(X, y, lambda0 = NULL, ...)

Arguments

X

nxp data matrix.

y

binary n-length vector containing the class of each observation.

lambda0

number between 0 and 1. If NULL, will use √2logp/n.

...

additional arguments to be passed to general decode function.

Value

An object of class decodeLDA containing:

eta

DECODE of Ωδ

X

training data used

y

training label used

and various outputs from decode function.

References

Hadimaja, M. Z., & Pun, C. S. (2018). A Self-Calibrated Regularized Direct Estimation for Graphical Selection and Discriminant Analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# for efficiency, we will only use 500 variables

# load the training data (Lung cancer data, cleaned)
data(lung.train) # 145 x 1578
X.train <- lung.train[,1:500]
y.train <- lung.train[,1578]

# build the DECODE
object <- decodeLDA(X.train, y.train)

object
summary(object)
coef(object)

# test on test data
data(lung.test)
X.test <- lung.test[,1:500]
y.test <- lung.test[,1578]
y.pred <- predict(object, X.test)
table(y.pred, y.test)

rDecode documentation built on Dec. 18, 2019, 5:08 p.m.

Related to decodeLDA in rDecode...