regularized_svd.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_SVD_HPP
14 #define MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_SVD_HPP
15 
16 #include <mlpack/prereqs.hpp>
18 #include <mlpack/methods/cf/cf.hpp>
19 
21 
22 namespace mlpack {
23 namespace svd {
24 
57 template<typename OptimizerType = mlpack::optimization::StandardSGD>
59 {
60  public:
71  RegularizedSVD(const size_t iterations = 10,
72  const double alpha = 0.01,
73  const double lambda = 0.02);
74 
83  void Apply(const arma::mat& data,
84  const size_t rank,
85  arma::mat& u,
86  arma::mat& v);
87 
88  private:
90  size_t iterations;
92  double alpha;
94  double lambda;
95 };
96 
97 } // namespace svd
98 } // namespace mlpack
99 
100 namespace mlpack {
101 namespace cf {
102 
104 template<>
106 {
107  public:
109  static const bool UsesCoordinateList = true;
110 };
111 
112 } // namespace cf
113 } // namespace mlpack
114 
115 // Include implementation.
116 #include "regularized_svd_impl.hpp"
117 
118 #endif
Regularized SVD is a matrix factorization technique that seeks to reduce the error on the training se...
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
RegularizedSVD(const size_t iterations=10, const double alpha=0.01, const double lambda=0.02)
Constructor for Regularized SVD.
void Apply(const arma::mat &data, const size_t rank, arma::mat &u, arma::mat &v)
Obtains the user and item matrices using the provided data and rank.
Template class for factorizer traits.
Definition: cf.hpp:39