mlpack  master
randomized_svd.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_RANDOMIZED_SVD_RANDOMIZED_SVD_HPP
14 #define MLPACK_METHODS_RANDOMIZED_SVD_RANDOMIZED_SVD_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace svd {
20 
67 {
68  public:
84  RandomizedSVD(const arma::mat& data,
85  arma::mat& u,
86  arma::vec& s,
87  arma::mat& v,
88  const size_t iteratedPower = 0,
89  const size_t maxIterations = 2,
90  const size_t rank = 0,
91  const double eps = 1e-7);
92 
103  RandomizedSVD(const size_t iteratedPower = 0,
104  const size_t maxIterations = 2,
105  const double eps = 1e-7);
106 
117  void Apply(const arma::mat& data,
118  arma::mat& u,
119  arma::vec& s,
120  arma::mat& v,
121  const size_t rank);
122 
124  size_t IteratedPower() const { return iteratedPower; }
126  size_t& IteratedPower() { return iteratedPower; }
127 
129  size_t MaxIterations() const { return maxIterations; }
131  size_t& MaxIterations() { return maxIterations; }
132 
134  double Epsilon() const { return eps; }
136  double& Epsilon() { return eps; }
137 
138  private:
141 
144 
146  double eps;
147 };
148 
149 } // namespace svd
150 } // namespace mlpack
151 
152 #endif
size_t maxIterations
Locally stored number of iterations for the power method.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
size_t IteratedPower() const
Get the size of the normalized power iterations.
void Apply(const arma::mat &data, arma::mat &u, arma::vec &s, arma::mat &v, const size_t rank)
Apply Principal Component Analysis to the provided data set using the randomized SVD.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t MaxIterations() const
Get the number of iterations for the power method.
double eps
The value used for numerical stability.
RandomizedSVD(const arma::mat &data, arma::mat &u, arma::vec &s, arma::mat &v, const size_t iteratedPower=0, const size_t maxIterations=2, const size_t rank=0, const double eps=1e-7)
Create object for the randomized SVD method.
size_t & MaxIterations()
Modify the number of iterations for the power method.
double & Epsilon()
Modify the value used for decomposition stability.
Randomized SVD is a matrix factorization that is based on randomized matrix approximation techniques...
size_t & IteratedPower()
Modify the size of the normalized power iterations.
size_t iteratedPower
Locally stored size of the normalized power iterations.
double Epsilon() const
Get the value used for decomposition stability.