PCA.cpp File Reference

Go to the source code of this file.

Functions

UnlabeledData< RealVector > createData ()
 The test distribution is just a multivariate Gaussian. More...
 
int main ()
 

Variables

double principalComponents [3][3]
 
std::size_t numberOfExamples = 30000
 

Function Documentation

◆ createData()

UnlabeledData<RealVector> createData ( )

The test distribution is just a multivariate Gaussian.

Definition at line 27 of file PCA.cpp.

References shark::covariance(), shark::mean(), and principalComponents.

Referenced by main().

◆ main()

int main ( )

Definition at line 61 of file PCA.cpp.

References createData(), shark::PCA::setWhitening(), and shark::PCA::train().

Variable Documentation

◆ numberOfExamples

std::size_t numberOfExamples = 30000

Definition at line 24 of file PCA.cpp.

◆ principalComponents

double principalComponents[3][3]
Initial value:
=
{
{ 5, 0, 0},
{ 0, 2, 2},
{ 0,-1, 1}
}

In this test, we will use PCA to calculate the eigenvectors of a scatter matrix and do a reduction of the subspace to the space spanned by the two eigenvectors with the biggest eigenvalues. the principal components of our multivariate data distribution we will use them later for checking

Definition at line 17 of file PCA.cpp.

Referenced by createData().