Implementation of the Batch SVD policy to act as a wrapper when accessing Batch SVD from within CFType. More...
Public Member Functions | |
template < typename MatType > | |
void | Apply (const MatType &, const arma::sp_mat &cleanedData, const size_t rank, const size_t maxIterations, const double minResidue, const bool mit) |
Apply Collaborative Filtering to the provided data set using the batch SVD method. 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... | |
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... | |
const arma::mat & | H () const |
Get the User Matrix. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialization. More... | |
const arma::mat & | W () const |
Get the Item Matrix. More... | |
Implementation of the Batch SVD policy to act as a wrapper when accessing Batch SVD from within CFType.
An example of how to use BatchSVDPolicy in CF is shown below:
Definition at line 43 of file batch_svd_method.hpp.
|
inline |
Apply Collaborative Filtering to the provided data set using the batch SVD method.
* | (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. |
Definition at line 59 of file batch_svd_method.hpp.
References AMF< TerminationPolicyType, InitializationRuleType, UpdateRuleType >::Apply().
|
inline |
Get the neighborhood and corresponding similarities for a set of users.
NeighborSearchPolicy | The policy to perform neighbor search. |
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. |
Definition at line 123 of file batch_svd_method.hpp.
|
inline |
Return predicted rating given user ID and item ID.
user | User ID. |
item | Item ID. |
Definition at line 93 of file batch_svd_method.hpp.
|
inline |
Get predicted ratings for a user.
user | User ID. |
rating | Resulting rating vector. |
Definition at line 105 of file batch_svd_method.hpp.
|
inline |
Get the User Matrix.
Definition at line 152 of file batch_svd_method.hpp.
|
inline |
Serialization.
Definition at line 158 of file batch_svd_method.hpp.
|
inline |
Get the Item Matrix.
Definition at line 150 of file batch_svd_method.hpp.