PCAWhitening Class Reference

A simple PCAWhitening class. More...

Public Member Functions

 PCAWhitening (double eps=0.00005)
 A constructor to set the regularization parameter. More...

 
const arma::vec & EigenValues () const
 Get the eigenvalues vector. More...

 
const arma::mat & EigenVectors () const
 Get the eigenvector. More...

 
const double & Epsilon () const
 Get the regularization parameter. More...

 
template
<
typename
MatType
>
void Fit (const MatType &input)
 Function to fit features, to find out the min max and scale. More...

 
template
<
typename
MatType
>
void InverseTransform (const MatType &input, MatType &output)
 Function to retrieve original dataset. More...

 
const arma::vec & ItemMean () const
 Get the mean row vector. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const unsigned int)
 
template
<
typename
MatType
>
void Transform (const MatType &input, MatType &output)
 Function for PCA whitening. More...

 

Detailed Description

A simple PCAWhitening class.

Whitens a matrix using the eigendecomposition of the covariance matrix. Whitening means the covariance matrix of the result is the identity matrix.

For whitening related formula and more info, check the link below. http://ufldl.stanford.edu/tutorial/unsupervised/PCAWhitening/

arma::mat input;
Load("train.csv", input);
arma::mat output;
// Fit the features.
scale.Fit(input)
// Scale the features.
scale.Transform(input, output);
// Retransform the input.
scale.InverseTransform(output, input);

Definition at line 46 of file pca_whitening.hpp.

Constructor & Destructor Documentation

◆ PCAWhitening()

PCAWhitening ( double  eps = 0.00005)
inline

A constructor to set the regularization parameter.

Parameters
epsRegularization parameter.

Definition at line 54 of file pca_whitening.hpp.

Member Function Documentation

◆ EigenValues()

const arma::vec& EigenValues ( ) const
inline

Get the eigenvalues vector.

Definition at line 116 of file pca_whitening.hpp.

Referenced by ZCAWhitening::EigenValues(), and ZCAWhitening::InverseTransform().

◆ EigenVectors()

const arma::mat& EigenVectors ( ) const
inline

Get the eigenvector.

Definition at line 118 of file pca_whitening.hpp.

Referenced by ZCAWhitening::EigenVectors(), ZCAWhitening::InverseTransform(), and ZCAWhitening::Transform().

◆ Epsilon()

const double& Epsilon ( ) const
inline

Get the regularization parameter.

Definition at line 120 of file pca_whitening.hpp.

Referenced by ZCAWhitening::Epsilon().

◆ Fit()

void Fit ( const MatType &  input)
inline

Function to fit features, to find out the min max and scale.

Parameters
inputDataset to fit.

Definition at line 70 of file pca_whitening.hpp.

References mlpack::math::ColumnCovariance().

Referenced by ZCAWhitening::Fit().

◆ InverseTransform()

void InverseTransform ( const MatType &  input,
MatType &  output 
)
inline

Function to retrieve original dataset.

Parameters
inputScaled dataset.
outputOutput matrix with original Dataset.

Definition at line 106 of file pca_whitening.hpp.

◆ ItemMean()

const arma::vec& ItemMean ( ) const
inline

Get the mean row vector.

Definition at line 114 of file pca_whitening.hpp.

Referenced by ZCAWhitening::InverseTransform(), and ZCAWhitening::ItemMean().

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)
inline

Definition at line 123 of file pca_whitening.hpp.

◆ Transform()

void Transform ( const MatType &  input,
MatType &  output 
)
inline

Function for PCA whitening.

Parameters
inputDataset to scale features.
outputOutput matrix with whitened features.

Definition at line 86 of file pca_whitening.hpp.

Referenced by ZCAWhitening::Transform().


The documentation for this class was generated from the following file:
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-3.2.1/src/mlpack/core/data/scaler_methods/pca_whitening.hpp