Description Usage Arguments Value References Examples
Implement DECODE
for simple LDA. The LDA assumes both classes have equal prior probabilities. This implementation is used in Hadimaja and Pun (2018).
1 |
X |
nxp data matrix. |
y |
binary n-length vector containing the class of each observation. |
lambda0 |
number between 0 and 1. If |
... |
additional arguments to be passed to general decode function. |
An object of class decodeLDA
containing:
eta |
|
X |
training data used |
y |
training label used |
and various outputs from decode
function.
Hadimaja, M. Z., & Pun, C. S. (2018). A Self-Calibrated Regularized Direct Estimation for Graphical Selection and Discriminant Analysis.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.