#include <yat/utility/PCA.h>
Public Member Functions | |
PCA (const utility::Matrix &) | |
const utility::Vector & | eigenvalues (void) const |
Returns eigenvalues in a utility::vector. | |
const utility::Matrix & | eigenvectors (void) const |
Get all eigenvectors in a utility::matrix. | |
utility::Matrix | projection (const utility::Matrix &) const |
Class performing PCA using SVD. This class assumes that the columns corresponds to the dimenension of the problem. That means if data has dimension NxM (M=columns) the number of principal-axes will equal M-1. When projecting data into this space, all Nx1 vectors will have dimension Mx1. Hence the projection will have dimension MxM where each column is a point in the new space.
theplu::yat::utility::PCA::PCA | ( | const utility::Matrix & | ) | [explicit] |
Constructor taking the data-matrix as input. No row-centering should have been performed and no products.
const utility::Vector& theplu::yat::utility::PCA::eigenvalues | ( | void | ) | const |
Returns eigenvalues in a utility::vector.
If M<N use this method instead. Using the same format as before where rows in the matrix corresponds to the dimensional coordinate. The only difference is in the SVD step where the matrix V is used after running the transposed matrix. For projections, see projection_transposed() method.
const utility::Matrix& theplu::yat::utility::PCA::eigenvectors | ( | void | ) | const |
Get all eigenvectors in a utility::matrix.
utility::Matrix theplu::yat::utility::PCA::projection | ( | const utility::Matrix & | ) | const |
This function will project data onto the new coordinate-system where the axes are the calculated eigenvectors. This means that PCA must have been run before this function can be used! Output is presented as coordinates in the N-dimensional room spanned by the eigenvectors.