Scroll to navigation

mlpack::svd::RegularizedSVDFunction(3) MLPACK mlpack::svd::RegularizedSVDFunction(3)

NAME

mlpack::svd::RegularizedSVDFunction -

SYNOPSIS

Public Member Functions


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

Private Attributes


const arma::mat & data
 
Rating data. arma::mat initialPoint
 
Initial parameter point. double lambda
 
Regularization parameter for the optimization. size_t numItems
 
Number of items in the given dataset. size_t numUsers
 
Number of users in the given dataset. size_t rank
 
Rank used for matrix factorization.

Detailed Description

Definition at line 32 of file regularized_svd_function.hpp.

Constructor & Destructor Documentation

mlpack::svd::RegularizedSVDFunction::RegularizedSVDFunction (const arma::mat &data, const size_trank, const doublelambda)

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:
data Dataset for which SVD is calculated.
 
rank Rank used for matrix factorization.
 
lambda Regularization parameter used for optimization.

Member Function Documentation

const arma::mat& mlpack::svd::RegularizedSVDFunction::Dataset () const [inline]

Return the dataset passed into the constructor.
Definition at line 80 of file regularized_svd_function.hpp.
References data.

double mlpack::svd::RegularizedSVDFunction::Evaluate (const arma::mat &parameters) const

Evaluates the cost function over all examples in the data.
Parameters:
parameters Parameters(user/item matrices) of the decomposition.

double mlpack::svd::RegularizedSVDFunction::Evaluate (const arma::mat &parameters, const size_ti) const

Evaluates the cost function for one training example. Useful for the SGD optimizer abstraction which uses one training example at a time.
Parameters:
parameters Parameters(user/item matrices) of the decomposition.
 
i Index of the training example to be used.

const arma::mat& mlpack::svd::RegularizedSVDFunction::GetInitialPoint () const [inline]

Return the initial point for the optimization.
Definition at line 77 of file regularized_svd_function.hpp.
References initialPoint.

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

Evaluates the full gradient of the cost function over all the training examples.
Parameters:
parameters Parameters(user/item matrices) of the decomposition.
 
gradient Calculated gradient for the parameters.

double mlpack::svd::RegularizedSVDFunction::Lambda () const [inline]

Return the regularization parameters.
Definition at line 92 of file regularized_svd_function.hpp.
References lambda.

size_t mlpack::svd::RegularizedSVDFunction::NumFunctions () const [inline]

Return the number of training examples. Useful for SGD optimizer.
Definition at line 83 of file regularized_svd_function.hpp.

size_t mlpack::svd::RegularizedSVDFunction::NumItems () const [inline]

Return the number of items in the data.
Definition at line 89 of file regularized_svd_function.hpp.
References numItems.

size_t mlpack::svd::RegularizedSVDFunction::NumUsers () const [inline]

Return the number of users in the data.
Definition at line 86 of file regularized_svd_function.hpp.
References numUsers.

size_t mlpack::svd::RegularizedSVDFunction::Rank () const [inline]

Return the rank used for the factorization.
Definition at line 95 of file regularized_svd_function.hpp.
References rank.

Member Data Documentation

const arma::mat& mlpack::svd::RegularizedSVDFunction::data [private]

Rating data.
Definition at line 99 of file regularized_svd_function.hpp.
Referenced by Dataset().

arma::mat mlpack::svd::RegularizedSVDFunction::initialPoint [private]

Initial parameter point.
Definition at line 101 of file regularized_svd_function.hpp.
Referenced by GetInitialPoint().

double mlpack::svd::RegularizedSVDFunction::lambda [private]

Regularization parameter for the optimization.
Definition at line 105 of file regularized_svd_function.hpp.
Referenced by Lambda().

size_t mlpack::svd::RegularizedSVDFunction::numItems [private]

Number of items in the given dataset.
Definition at line 109 of file regularized_svd_function.hpp.
Referenced by NumItems().

size_t mlpack::svd::RegularizedSVDFunction::numUsers [private]

Number of users in the given dataset.
Definition at line 107 of file regularized_svd_function.hpp.
Referenced by NumUsers().

size_t mlpack::svd::RegularizedSVDFunction::rank [private]

Rank used for matrix factorization.
Definition at line 103 of file regularized_svd_function.hpp.
Referenced by Rank().

Author

Generated automatically by Doxygen for MLPACK from the source code.
Tue Sep 9 2014 Version 1.0.10