mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::amf::SVDIncompleteIncrementalLearning Class Reference

This class computes SVD using incomplete incremental batch learning, as described in the following paper: More...

Public Member Functions

 SVDIncompleteIncrementalLearning (double u=0.001, double kw=0, double kh=0)
 Initialize the parameters of SVDIncompleteIncrementalLearning. More...
 
template<typename MatType >
void HUpdate (const MatType &V, const arma::mat &W, arma::mat &H)
 The update rule for the encoding matrix H. More...
 
template<typename MatType >
void Initialize (const MatType &, const size_t)
 Initialize parameters before factorization. More...
 
template<typename MatType >
void WUpdate (const MatType &V, arma::mat &W, const arma::mat &H)
 The update rule for the basis matrix W. More...
 

Private Attributes

size_t currentUserIndex
 Current user under consideration. More...
 
double kh
 Regularization parameter for H matrix. More...
 
double kw
 Regularization parameter for W matrix. More...
 
double u
 Step size of batch learning. More...
 

Detailed Description

This class computes SVD using incomplete incremental batch learning, as described in the following paper:

@techreport{ma2008guide,
title={A Guide to Singular Value Decomposition for Collaborative
Filtering},
author={Ma, Chih-Chao},
year={2008},
institution={Department of Computer Science, National Taiwan University}
}

This class implements 'Algorithm 2' as given in the paper. Incremental learning modifies only some feature values in W and H after scanning part of the input matrix (V). This differs from batch learning, which considers every element in V for each update of W and H. The regularization technique is also different: in incomplete incremental learning, regularization takes into account the number of elements in a given column of V.

See also
SVDBatchLearning

Definition at line 43 of file svd_incomplete_incremental_learning.hpp.

Constructor & Destructor Documentation

mlpack::amf::SVDIncompleteIncrementalLearning::SVDIncompleteIncrementalLearning ( double  u = 0.001,
double  kw = 0,
double  kh = 0 
)
inline

Initialize the parameters of SVDIncompleteIncrementalLearning.

Parameters
uStep value used in batch learning.
kwRegularization constant for W matrix.
khRegularization constant for H matrix.

Definition at line 53 of file svd_incomplete_incremental_learning.hpp.

Member Function Documentation

template<typename MatType >
void mlpack::amf::SVDIncompleteIncrementalLearning::HUpdate ( const MatType &  V,
const arma::mat &  W,
arma::mat &  H 
)
inline

The update rule for the encoding matrix H.

The function takes in all the matrices and only changes the value of the H matrix.

Parameters
VInput matrix to be factorized.
WBasis matrix.
HEncoding matrix to be updated.

Definition at line 119 of file svd_incomplete_incremental_learning.hpp.

References currentUserIndex, kh, and u.

template<typename MatType >
void mlpack::amf::SVDIncompleteIncrementalLearning::Initialize ( const MatType &  ,
const size_t   
)
inline

Initialize parameters before factorization.

This function must be called before a new factorization. This simply sets the column being considered to 0, so the input matrix and rank are not used.

Parameters
datasetInput matrix to be factorized.
rankrank of factorization

Definition at line 70 of file svd_incomplete_incremental_learning.hpp.

References currentUserIndex.

template<typename MatType >
void mlpack::amf::SVDIncompleteIncrementalLearning::WUpdate ( const MatType &  V,
arma::mat &  W,
const arma::mat &  H 
)
inline

The update rule for the basis matrix W.

The function takes in all the matrices and only changes the value of the W matrix.

Parameters
VInput matrix to be factorized.
WBasis matrix to be updated.
HEncoding matrix.

Definition at line 86 of file svd_incomplete_incremental_learning.hpp.

References currentUserIndex, kw, and u.

Member Data Documentation

size_t mlpack::amf::SVDIncompleteIncrementalLearning::currentUserIndex
private
double mlpack::amf::SVDIncompleteIncrementalLearning::kh
private

Regularization parameter for H matrix.

Definition at line 151 of file svd_incomplete_incremental_learning.hpp.

Referenced by HUpdate(), and mlpack::amf::SVDIncompleteIncrementalLearning::HUpdate< arma::sp_mat >().

double mlpack::amf::SVDIncompleteIncrementalLearning::kw
private

Regularization parameter for W matrix.

Definition at line 149 of file svd_incomplete_incremental_learning.hpp.

Referenced by mlpack::amf::SVDIncompleteIncrementalLearning::WUpdate< arma::sp_mat >(), and WUpdate().

double mlpack::amf::SVDIncompleteIncrementalLearning::u
private

The documentation for this class was generated from the following file: