spca | R Documentation |
spca
computes supervised principal component analysis as
described in Barshan et al.
spca(x, y = diag(1, nrow(x)),
center = TRUE, scale = FALSE,
retx = FALSE, debug = FALSE)
x |
a data matrix (features in columns, samples in rows) |
y |
target classification of |
center |
a logical value indicating whether to |
scale |
a logical value indicating whether to |
retx |
a logical value indicating whether to return the rotated version of 'x' |
debug |
if TRUE, debugs will be printed. If numeric of value greater than 1, verbose debugs will be produced. |
Eigenvalue decomposition of Q
(see the paper). The value is a
list of values
and vectors
components (see
eigen
,
Q
, the matrix being decomposed, and center
and scale
holding the centering and scaling used, or FALSE
.
If retx
is TRUE
, the rotated version of x
is returned in x
.
The number of eigenvalues and eigenvectors correspond to the
dimension of the output space.
Tomas Sieger
Barshan, E., Ghodsi, A., Azimifar, Z., Jahromi, M. Z. _Supervised principal component analysis: Visualization, classification and regression on subspaces and submanifolds_. Pattern Recognition, Vol. 44, No. 7. (29 July 2011), pp. 1357-1371, doi:10.1016/j.patcog.2010.12.015.
spca(iris[,1:4],iris$Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.