Implementation of the SVDPlusPlus policy to act as a wrapper when accessing SVDPlusPlus from within CFType.
More...
#include <svdplusplus_method.hpp>
|
| | SVDPlusPlusPolicy (const size_t maxIterations=10, const double alpha=0.001, const double lambda=0.1) |
| | Use SVDPlusPlus method to perform collaborative filtering. More...
|
| |
| void | Apply (const arma::mat &data, const arma::sp_mat &, const size_t rank, const size_t maxIterations, const double, const bool) |
| | Apply Collaborative Filtering to the provided data set using the svdplusplus. More...
|
| |
| double | GetRating (const size_t user, const size_t item) const |
| | Return predicted rating given user ID and item ID. More...
|
| |
| void | GetRatingOfUser (const size_t user, arma::vec &rating) const |
| | Get predicted ratings for a user. More...
|
| |
| template<typename NeighborSearchPolicy > |
| void | GetNeighborhood (const arma::Col< size_t > &users, const size_t numUsersForSimilarity, arma::Mat< size_t > &neighborhood, arma::mat &similarities) const |
| | Get the neighborhood and corresponding similarities for a set of users. More...
|
| |
|
const arma::mat & | W () const |
| | Get the Item Matrix.
|
| |
|
const arma::mat & | H () const |
| | Get the User Matrix.
|
| |
|
const arma::vec & | Q () const |
| | Get the User Bias Vector.
|
| |
|
const arma::vec & | P () const |
| | Get the Item Bias Vector.
|
| |
|
const arma::mat & | Y () const |
| | Get the Item Implicit Matrix.
|
| |
|
const arma::sp_mat & | ImplicitData () const |
| | Get Implicit Feedback Data.
|
| |
|
size_t | MaxIterations () const |
| | Get the number of iterations.
|
| |
|
size_t & | MaxIterations () |
| | Modify the number of iterations.
|
| |
|
double | Alpha () const |
| | Get learning rate.
|
| |
|
double & | Alpha () |
| | Modify learning rate.
|
| |
|
double | Lambda () const |
| | Get regularization parameter.
|
| |
|
double & | Lambda () |
| | Modify regularization parameter.
|
| |
|
template<typename Archive > |
| void | serialize (Archive &ar, const uint32_t) |
| | Serialization.
|
| |
Implementation of the SVDPlusPlus policy to act as a wrapper when accessing SVDPlusPlus from within CFType.
An example of how to use SVDPlusPlusPolicy in CF is shown below:
extern arma::mat data;
extern arma::Col<size_t> users;
arma::Mat<size_t> recommendations;
CFType<SVDPlusPlusPolicy> cf(data);
cf.GetRecommendations(10, recommendations);
◆ SVDPlusPlusPolicy()
| mlpack::cf::SVDPlusPlusPolicy::SVDPlusPlusPolicy |
( |
const size_t |
maxIterations = 10, |
|
|
const double |
alpha = 0.001, |
|
|
const double |
lambda = 0.1 |
|
) |
| |
|
inline |
Use SVDPlusPlus method to perform collaborative filtering.
- Parameters
-
| maxIterations | Number of iterations. |
| alpha | Learning rate for optimization. |
| lambda | Regularization parameter for optimization. |
◆ Apply()
| void mlpack::cf::SVDPlusPlusPolicy::Apply |
( |
const arma::mat & |
data, |
|
|
const arma::sp_mat & |
, |
|
|
const size_t |
rank, |
|
|
const size_t |
maxIterations, |
|
|
const double |
, |
|
|
const bool |
|
|
) |
| |
|
inline |
Apply Collaborative Filtering to the provided data set using the svdplusplus.
- Parameters
-
| data | Data matrix: dense matrix (coordinate lists) or sparse matrix(cleaned). |
| * | (cleanedData) item user table in form of sparse matrix. |
| rank | Rank parameter for matrix factorization. |
| maxIterations | Maximum number of iterations. |
| * | (minResidue) Residue required to terminate. |
| * | (mit) Whether to terminate only when maxIterations is reached. |
◆ GetNeighborhood()
template<typename NeighborSearchPolicy >
| void mlpack::cf::SVDPlusPlusPolicy::GetNeighborhood |
( |
const arma::Col< size_t > & |
users, |
|
|
const size_t |
numUsersForSimilarity, |
|
|
arma::Mat< size_t > & |
neighborhood, |
|
|
arma::mat & |
similarities |
|
) |
| const |
|
inline |
Get the neighborhood and corresponding similarities for a set of users.
- Template Parameters
-
| NeighborSearchPolicy | The policy to perform neighbor search. |
- Parameters
-
| users | Users whose neighborhood is to be computed. |
| numUsersForSimilarity | The number of neighbors returned for each user. |
| neighborhood | Neighbors represented by user IDs. |
| similarities | Similarity between each user and each of its neighbors. |
◆ GetRating()
| double mlpack::cf::SVDPlusPlusPolicy::GetRating |
( |
const size_t |
user, |
|
|
const size_t |
item |
|
) |
| const |
|
inline |
Return predicted rating given user ID and item ID.
- Parameters
-
| user | User ID. |
| item | Item ID. |
◆ GetRatingOfUser()
| void mlpack::cf::SVDPlusPlusPolicy::GetRatingOfUser |
( |
const size_t |
user, |
|
|
arma::vec & |
rating |
|
) |
| const |
|
inline |
Get predicted ratings for a user.
- Parameters
-
| user | User ID. |
| rating | Resulting rating vector. |
The documentation for this class was generated from the following file: