decodeLDA {rDecode} | R Documentation |
Implement DECODE
for simple LDA
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
decodeLDA(X, y, lambda0 = NULL, ...)
Arguments
X |
|
y |
binary |
lambda0 |
number between 0 and 1. If |
... |
additional arguments to be passed to general decode function. |
Value
An object of class decodeLDA
containing:
eta |
|
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
# 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)
[Package rDecode version 0.1.0 Index]