14#ifndef MLPACK_METHODS_PCA_DECOMPOSITION_POLICIES_RANDOMIZED_SVD_METHOD_HPP
15#define MLPACK_METHODS_PCA_DECOMPOSITION_POLICIES_RANDOMIZED_SVD_METHOD_HPP
39 const size_t maxIterations = 2) :
40 iteratedPower(iteratedPower),
41 maxIterations(maxIterations)
57 void Apply(
const arma::mat& data,
58 const arma::mat& centeredData,
59 arma::mat& transformedData,
69 rsvd.
Apply(data, eigvec, eigVal, v, rank);
74 eigVal %= eigVal / (data.n_cols - 1);
77 transformedData = arma::trans(eigvec) * centeredData;
Implementation of the randomized SVD policy.
size_t MaxIterations() const
Get the number of iterations for the power method.
void Apply(const arma::mat &data, const arma::mat ¢eredData, arma::mat &transformedData, arma::vec &eigVal, arma::mat &eigvec, const size_t rank)
Apply Principal Component Analysis to the provided data set using the randomized SVD.
size_t & MaxIterations()
Modify the number of iterations for the power method.
RandomizedSVDPolicy(const size_t iteratedPower=0, const size_t maxIterations=2)
Use randomized SVD method to perform the principal components analysis (PCA).
size_t IteratedPower() const
Get the size of the normalized power iterations.
size_t & IteratedPower()
Modify the size of the normalized power iterations.
Randomized SVD is a matrix factorization that is based on randomized matrix approximation techniques,...
void Apply(const arma::sp_mat &data, arma::mat &u, arma::vec &s, arma::mat &v, const size_t rank)
Center the data to apply Principal Component Analysis on given sparse matrix dataset using randomized...
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.