yat  0.20.3pre
Public Member Functions | List of all members
theplu::yat::utility::PCA Class Reference

Principal Component Analysis. More...

#include <yat/utility/PCA.h>

Public Member Functions

 PCA (const MatrixBase &)
 
 PCA (MatrixMutable &&M)
 
const Vectoreigenvalues (void) const
 Returns eigenvalues. More...
 
const Matrixeigenvectors (void) const
 Get all eigenvectors in a Matrix. More...
 
Matrix projection (const MatrixBase &) const
 

Detailed Description

Principal Component Analysis.

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.

Note
Currently number of rows, N, must be larger (or equal) than number of columns, M.

Constructor & Destructor Documentation

◆ PCA() [1/2]

theplu::yat::utility::PCA::PCA ( const MatrixBase )
explicit

Constructor taking the data-matrix as input. No row-centering should have been performed and no products.

◆ PCA() [2/2]

theplu::yat::utility::PCA::PCA ( MatrixMutable &&  M)
explicit

Same as PCA(const Matrix&) but moves M rather than copy.

Since
new in yat 0.16

Member Function Documentation

◆ eigenvalues()

const Vector& theplu::yat::utility::PCA::eigenvalues ( void  ) const

Returns eigenvalues.

Returns
A const reference to the internal vector containing all eigenvalues.

◆ eigenvectors()

const Matrix& theplu::yat::utility::PCA::eigenvectors ( void  ) const

Get all eigenvectors in a Matrix.

Returns
A const reference to the internal matrix containing all eigenvectors.

◆ projection()

Matrix theplu::yat::utility::PCA::projection ( const MatrixBase ) 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.


The documentation for this class was generated from the following file:

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14