mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
RegularizedSVDFunction Class Reference

Public Member Functions

 RegularizedSVDFunction (const arma::mat &data, const size_t rank, const double lambda)
 Constructor for RegularizedSVDFunction class. More...
 
const arma::mat & Dataset () const
 Return the dataset passed into the constructor. More...
 
double Evaluate (const arma::mat &parameters) const
 Evaluates the cost function over all examples in the data. More...
 
double Evaluate (const arma::mat &parameters, const size_t i) const
 Evaluates the cost function for one training example. More...
 
const arma::mat & GetInitialPoint () const
 Return the initial point for the optimization. More...
 
void Gradient (const arma::mat &parameters, arma::mat &gradient) const
 Evaluates the full gradient of the cost function over all the training examples. More...
 
double Lambda () const
 Return the regularization parameters. More...
 
size_t NumFunctions () const
 Return the number of training examples. Useful for SGD optimizer. More...
 
size_t NumItems () const
 Return the number of items in the data. More...
 
size_t NumUsers () const
 Return the number of users in the data. More...
 
size_t Rank () const
 Return the rank used for the factorization. More...
 

Detailed Description

Definition at line 22 of file regularized_svd_function.hpp.

Constructor & Destructor Documentation

RegularizedSVDFunction ( const arma::mat &  data,
const size_t  rank,
const double  lambda 
)

Constructor for RegularizedSVDFunction class.

The constructor calculates the number of users and items in the passed data. It also randomly initializes the parameter values.

Parameters
dataDataset for which SVD is calculated.
rankRank used for matrix factorization.
lambdaRegularization parameter used for optimization.

Member Function Documentation

const arma::mat& Dataset ( ) const
inline

Return the dataset passed into the constructor.

Definition at line 70 of file regularized_svd_function.hpp.

double Evaluate ( const arma::mat &  parameters) const

Evaluates the cost function over all examples in the data.

Parameters
parametersParameters(user/item matrices) of the decomposition.
double Evaluate ( const arma::mat &  parameters,
const size_t  i 
) const

Evaluates the cost function for one training example.

Useful for the SGD optimizer abstraction which uses one training example at a time.

Parameters
parametersParameters(user/item matrices) of the decomposition.
iIndex of the training example to be used.
const arma::mat& GetInitialPoint ( ) const
inline

Return the initial point for the optimization.

Definition at line 67 of file regularized_svd_function.hpp.

void Gradient ( const arma::mat &  parameters,
arma::mat &  gradient 
) const

Evaluates the full gradient of the cost function over all the training examples.

Parameters
parametersParameters(user/item matrices) of the decomposition.
gradientCalculated gradient for the parameters.
double Lambda ( ) const
inline

Return the regularization parameters.

Definition at line 82 of file regularized_svd_function.hpp.

size_t NumFunctions ( ) const
inline

Return the number of training examples. Useful for SGD optimizer.

Definition at line 73 of file regularized_svd_function.hpp.

size_t NumItems ( ) const
inline

Return the number of items in the data.

Definition at line 79 of file regularized_svd_function.hpp.

size_t NumUsers ( ) const
inline

Return the number of users in the data.

Definition at line 76 of file regularized_svd_function.hpp.

size_t Rank ( ) const
inline

Return the rank used for the factorization.

Definition at line 85 of file regularized_svd_function.hpp.


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