RegularizedSVD< OptimizerType > Class Template Reference

Regularized SVD is a matrix factorization technique that seeks to reduce the error on the training set, that is on the examples for which the ratings have been provided by the users. More...

Public Member Functions

 RegularizedSVD (const size_t iterations=10, const double alpha=0.01, const double lambda=0.02)
 Constructor for Regularized SVD. More...

 
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. More...

 

Detailed Description


template
<
typename
OptimizerType
=
ens::StandardSGD
>

class mlpack::svd::RegularizedSVD< OptimizerType >

Regularized SVD is a matrix factorization technique that seeks to reduce the error on the training set, that is on the examples for which the ratings have been provided by the users.

It is a fairly straightforward technique where the user and item matrices are updated with the help of Stochastic Gradient Descent(SGD) updates. The updates also penalize the learning of large feature values by means of regularization. More details can be found in the following links:

http://sifter.org/~simon/journal/20061211.html http://www.cs.uic.edu/~liub/KDD-cup-2007/proceedings/Regular-Paterek.pdf

An example of how to use the interface is shown below:

arma::mat data; // Rating data in the form of coordinate list.
const size_t rank = 20; // Rank used for the decomposition.
const size_t iterations = 10; // Number of iterations used for optimization.
const double alpha = 0.01 // Learning rate for the SGD optimizer.
const double lambda = 0.1 // Regularization parameter for the optimization.
// Make a RegularizedSVD object.
RegularizedSVD<> rSVD(iterations, alpha, lambda);
arma::mat u, v; // User and item matrices.
// Use the Apply() method to get a factorization.
rSVD.Apply(data, rank, u, v);

Definition at line 58 of file regularized_svd.hpp.

Constructor & Destructor Documentation

◆ RegularizedSVD()

RegularizedSVD ( const size_t  iterations = 10,
const double  alpha = 0.01,
const double  lambda = 0.02 
)

Constructor for Regularized SVD.

Obtains the user and item matrices after training on the passed data. The constructor initiates an object of class RegularizedSVDFunction for optimization. It uses the SGD optimizer by default. The optimizer uses a template specialization of Optimize().

Parameters
iterationsNumber of optimization iterations.
alphaLearning rate for the SGD optimizer.
lambdaRegularization parameter for the optimization.

Member Function Documentation

◆ 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.

Parameters
dataRating data matrix.
rankRank parameter to be used for optimization.
uItem matrix obtained on decomposition.
vUser matrix obtained on decomposition.

Referenced by RegSVDPolicy::Apply().


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-3.3.2/src/mlpack/methods/regularized_svd/regularized_svd.hpp