mlpack 3.4.2
bias_svd.hpp
Go to the documentation of this file.
1
14#ifndef MLPACK_METHODS_BIAS_SVD_BIAS_SVD_HPP
15#define MLPACK_METHODS_BIAS_SVD_BIAS_SVD_HPP
16
17#include <mlpack/prereqs.hpp>
18#include <ensmallen.hpp>
20
21#include "bias_svd_function.hpp"
22
23namespace mlpack {
24namespace svd {
25
56template<typename OptimizerType = ens::StandardSGD>
58{
59 public:
68 BiasSVD(const size_t iterations = 10,
69 const double alpha = 0.02,
70 const double lambda = 0.05);
71
82 void Apply(const arma::mat& data,
83 const size_t rank,
84 arma::mat& u,
85 arma::mat& v,
86 arma::vec& p,
87 arma::vec& q);
88
89 private:
91 size_t iterations;
93 double alpha;
95 double lambda;
96};
97
98} // namespace svd
99} // namespace mlpack
100
101// Include implementation.
102#include "bias_svd_impl.hpp"
103
104#endif
Bias SVD is an improvement on Regularized SVD which is a matrix factorization techniques.
Definition: bias_svd.hpp:58
BiasSVD(const size_t iterations=10, const double alpha=0.02, const double lambda=0.05)
Constructor of Bias SVD.
void Apply(const arma::mat &data, const size_t rank, arma::mat &u, arma::mat &v, arma::vec &p, arma::vec &q)
Trains the model and obtains user/item matrices and user/item bias.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.