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 
73 template<typename OptimizerType = ens::StandardSGD>
75 {
76  public:
85  SVDPlusPlus(const size_t iterations = 10,
86  const double alpha = 0.001,
87  const double lambda = 0.1);
88 
102  void Apply(const arma::mat& data,
103  const arma::mat& implicitData,
104  const size_t rank,
105  arma::mat& u,
106  arma::mat& v,
107  arma::vec& p,
108  arma::vec& q,
109  arma::mat& y);
110 
125  void Apply(const arma::mat& data,
126  const size_t rank,
127  arma::mat& u,
128  arma::mat& v,
129  arma::vec& p,
130  arma::vec& q,
131  arma::mat& y);
132 
136  static void CleanData(const arma::mat& implicitData,
137  arma::sp_mat& cleanedData,
138  const arma::mat& data);
139 
140  private:
142  size_t iterations;
144  double alpha;
146  double lambda;
147 };
148 
149 } // namespace svd
150 } // namespace mlpack
151 
152 // Include implementation.
153 #include "svdplusplus_impl.hpp"
154 
155 #endif
SVD++ is a matrix decomposition tenique used in collaborative filtering.
Definition: svdplusplus.hpp:74
SVDPlusPlus(const size_t iterations=10, const double alpha=0.001, const double lambda=0.1)
Constructor of SVDPlusPlus.
strip_type.hpp
Definition: add_to_po.hpp:21
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...