svdplusplus.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_METHODS_SVDPLUSPLUS_SVDPLUSPLUS_HPP
15 #define MLPACK_METHODS_SVDPLUSPLUS_SVDPLUSPLUS_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 #include <mlpack/methods/cf/cf.hpp>
19 
20 #include <ensmallen.hpp>
21 
22 #include "svdplusplus_function.hpp"
23 
24 namespace mlpack {
25 namespace svd {
26 
75 template<typename OptimizerType = ens::StandardSGD>
77 {
78  public:
87  SVDPlusPlus(const size_t iterations = 10,
88  const double alpha = 0.001,
89  const double lambda = 0.1);
90 
104  void Apply(const arma::mat& data,
105  const arma::mat& implicitData,
106  const size_t rank,
107  arma::mat& u,
108  arma::mat& v,
109  arma::vec& p,
110  arma::vec& q,
111  arma::mat& y);
112 
127  void Apply(const arma::mat& data,
128  const size_t rank,
129  arma::mat& u,
130  arma::mat& v,
131  arma::vec& p,
132  arma::vec& q,
133  arma::mat& y);
134 
138  static void CleanData(const arma::mat& implicitData,
139  arma::sp_mat& cleanedData,
140  const arma::mat& data);
141 
142  private:
144  size_t iterations;
146  double alpha;
148  double lambda;
149 };
150 
151 } // namespace svd
152 } // namespace mlpack
153 
154 // Include implementation.
155 #include "svdplusplus_impl.hpp"
156 
157 #endif
SVD++ is a matrix decomposition tenique used in collaborative filtering.
Definition: svdplusplus.hpp:76
SVDPlusPlus(const size_t iterations=10, const double alpha=0.001, const double lambda=0.1)
Constructor of SVDPlusPlus.
Linear algebra utility functions, generally performed on matrices or vectors.
static void CleanData(const arma::mat &implicitData, arma::sp_mat &cleanedData, const arma::mat &data)
Converts the User, Item matrix of implicit data to Item-User Table.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Apply(const arma::mat &data, const arma::mat &implicitData, const size_t rank, arma::mat &u, arma::mat &v, arma::vec &p, arma::vec &q, arma::mat &y)
Trains the model and obtains user/item matrices, user/item bias, and item implicit matrix...