mlpack
3.4.2
mlpack-3.4.2
src
mlpack
methods
regularized_svd
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
>
17
#include <ensmallen.hpp>
18
#include <
mlpack/methods/cf/cf.hpp
>
19
20
#include "
regularized_svd_function.hpp
"
21
22
namespace
mlpack
{
23
namespace
svd {
24
57
template
<
typename
OptimizerType = ens::StandardSGD>
58
class
RegularizedSVD
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
// Include implementation.
101
#include "regularized_svd_impl.hpp"
102
103
#endif
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition:
add_to_cli11.hpp:21
mlpack::svd::RegularizedSVD
Regularized SVD is a matrix factorization technique that seeks to reduce the error on the training se...
Definition:
regularized_svd.hpp:59
cf.hpp
regularized_svd_function.hpp
mlpack::svd::RegularizedSVD::Apply
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.
mlpack::svd::RegularizedSVD::RegularizedSVD
RegularizedSVD(const size_t iterations=10, const double alpha=0.01, const double lambda=0.02)
Constructor for Regularized SVD.
Generated by
1.8.20