dtrda | R Documentation |
Finds a low-dimensional discriminant subspace that maximizes the between-class scatter while controlling the within-class scatter.
dtrda(X, Y, preproc = multivarious::center(), d = 2, alpha)
X |
numeric matrix of predictors, of dimension n x p. |
Y |
factor variable of class labels, of length n. |
preproc |
A preprocessing function to apply to the data. Default is centering. |
d |
integer, the dimension of the discriminant subspace. Must be <= K-1 where K is the number of classes. |
alpha |
numeric, tuning parameter in 0,1 that controls the trade-off between between-class and within-class scatters. |
An S3 object of class "discriminant_projector" containing the transformation matrix W, the transformed scores, and related metadata.
Ahn, J., Chung, H. C., & Jeon, Y. (2021). Trace Ratio Optimization for High-Dimensional Multi-Class Discrimination. Journal of Computational and Graphical Statistics, 30(1), 192-203. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2020.1807352")}
X = matrix(rnorm(100*1000), 100, 1000)
y = sample(1:3, 100, replace=TRUE)
V = dtrda(X, y, d=2, alpha=0.5, lambda=0.1)
Xp = X %*% V # project data onto discriminant subspace
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.