pca {mining} | R Documentation |
Computes a projection matrix that preserves spread.
pca(x,k=1)
x |
a data frame. |
k |
the number of dimensions to project down to. |
The projection is chosen so that the projected data is as "spread out"
as possible, measured according to the determinant of the covariance
matrix.
This turns out to be the top k
eigenvectors of the data
covariance matrix.
The projection is "stabilized" so that small changes in the data do not cause sign flips in the projection.
A matrix with named rows matching the numeric columns of x
and
columns named h1
, ..., hk
.
Each column denotes a new dimension to be obtained as a linear combination
of the numeric variables in x
.
Tom Minka
project
, projection
,
pca
in the multiv
package
data(Housing) w = pca(HousingT,k=2) plot(project(HousingT,w),asp=1) plot.axes(w)