mlpack  2.0.1
regularized_svd.hpp
Go to the documentation of this file.
1 
15 #ifndef __MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_SVD_HPP
16 #define __MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_SVD_HPP
17 
18 #include <mlpack/core.hpp>
20 #include <mlpack/methods/cf/cf.hpp>
21 
23 
24 namespace mlpack {
25 namespace svd {
26 
60 template<
61  template<typename> class OptimizerType = mlpack::optimization::SGD
62 >
64 {
65  public:
66 
77  RegularizedSVD(const size_t iterations = 10,
78  const double alpha = 0.01,
79  const double lambda = 0.02);
80 
89  void Apply(const arma::mat& data,
90  const size_t rank,
91  arma::mat& u,
92  arma::mat& v);
93 
94  private:
96  size_t iterations;
98  double alpha;
100  double lambda;
101 };
102 
103 } // namespace svd
104 } // namespace mlpack
105 
106 namespace mlpack {
107 namespace cf {
108 
110 template<>
112 {
113  public:
115  static const bool UsesCoordinateList = true;
116 };
117 
118 } // namespace cf
119 } // namespace mlpack
120 
121 // Include implementation.
122 #include "regularized_svd_impl.hpp"
123 
124 #endif
size_t iterations
Number of optimization iterations.
Regularized SVD is a matrix factorization technique that seeks to reduce the error on the training se...
RegularizedSVD(const size_t iterations=10, const double alpha=0.01, const double lambda=0.02)
Constructor for Regularized SVD.
Linear algebra utility functions, generally performed on matrices or vectors.
double lambda
Regularization parameter for the optimization.
double alpha
Learning rate for the SGD optimizer.
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.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...
Definition: sgd.hpp:78
Template class for factorizer traits.
Definition: cf.hpp:41