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)
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;
size_t & IteratedPower()
Modify the size of the normalized power iterations.
Definition: randomized_svd_method.hpp:83
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t MaxIterations() const
Get the number of iterations for the power method.
Definition: randomized_svd_method.hpp:86
RandomizedSVDPolicy(const size_t iteratedPower=0, const size_t maxIterations=2)
Use randomized SVD method to perform the principal components analysis (PCA).
Definition: randomized_svd_method.hpp:38
size_t & MaxIterations()
Modify the number of iterations for the power method.
Definition: randomized_svd_method.hpp:88
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.
Definition: randomized_svd_method.hpp:57
Randomized SVD is a matrix factorization that is based on randomized matrix approximation techniques...
Definition: randomized_svd.hpp:66
Implementation of the randomized SVD policy.
Definition: randomized_svd_method.hpp:26
size_t IteratedPower() const
Get the size of the normalized power iterations.
Definition: randomized_svd_method.hpp:81
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...
Definition: randomized_svd.cpp:51