svd_incomplete_method.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_METHODS_PCA_DECOMPOSITION_POLICIES_SVD_INCOMPLETE_HPP
15 #define MLPACK_METHODS_PCA_DECOMPOSITION_POLICIES_SVD_INCOMPLETE_HPP
16 
17 #include <mlpack/prereqs.hpp>
22 
23 namespace mlpack {
24 namespace cf {
25 
31 {
32  public:
47  template<typename MatType>
48  void Apply(const MatType& /* data */,
49  const arma::sp_mat& cleanedData,
50  const size_t rank,
51  arma::mat& w,
52  arma::mat& h,
53  const size_t maxIterations,
54  const double minResidue,
55  const bool mit)
56  {
57  if (mit)
58  {
59  amf::MaxIterationTermination iter(maxIterations);
60 
61  // Do singular value decomposition using incomplete incremental method.
64 
65  svdici.Apply(cleanedData, rank, w, h);
66  }
67  else
68  {
69  amf::SimpleResidueTermination srt(minResidue, maxIterations);
70 
71  // Do singular value decomposition using incomplete incremental method
72  // using cleaned data in form of sparse matrix.
74 
75  svdici.Apply(cleanedData, rank, w, h);
76  }
77  }
78 };
79 
80 } // namespace cf
81 } // namespace mlpack
82 
83 #endif
Implementation of the SVD incomplete incremental to act as a wrapper when accessing SVD incomplete in...
This class implements AMF (alternating matrix factorization) on the given matrix V.
Definition: amf.hpp:78
This class computes SVD using incomplete incremental batch learning, as described in the following pa...
This initialization rule for AMF simply fills the W and H matrices with uniform random noise in [0...
Definition: random_init.hpp:25
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
This class implements a simple residue-based termination policy.
double Apply(const MatType &V, const size_t r, arma::mat &W, arma::mat &H)
Apply Alternating Matrix Factorization to the provided matrix.
This termination policy only terminates when the maximum number of iterations has been reached...
void Apply(const MatType &, const arma::sp_mat &cleanedData, const size_t rank, arma::mat &w, arma::mat &h, const size_t maxIterations, const double minResidue, const bool mit)
Apply Collaborative Filtering to the provided data set using the SVD incomplete incremental method...