Implementation of the Bias SVD policy to act as a wrapper when accessing Bias SVD from within CFType. More...
Public Member Functions | |
| BiasSVDPolicy (const size_t maxIterations=10, const double alpha=0.02, const double lambda=0.05) | |
| Use Bias SVD method to perform collaborative filtering. More... | |
| double | Alpha () const |
| Get learning rate. More... | |
| double & | Alpha () |
| Modify learning rate. 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 bias SVD. 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... | |
| double | Lambda () const |
| Get regularization parameter. More... | |
| double & | Lambda () |
| Modify regularization parameter. More... | |
| size_t | MaxIterations () const |
| Get the number of iterations. More... | |
| size_t & | MaxIterations () |
| Modify the number of iterations. More... | |
| const arma::vec & | P () const |
| Get the Item Bias Vector. More... | |
| const arma::vec & | Q () const |
| Get the User Bias Vector. 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 Bias SVD policy to act as a wrapper when accessing Bias SVD from within CFType.
An example of how to use BiasSVDPolicy in CF is shown below:
Definition at line 41 of file bias_svd_method.hpp.
|
inline |
Use Bias SVD method to perform collaborative filtering.
| maxIterations | Number of iterations. |
| alpha | Learning rate for optimization. |
| lambda | Regularization parameter for optimization. |
Definition at line 51 of file bias_svd_method.hpp.
|
inline |
Get learning rate.
Definition at line 154 of file bias_svd_method.hpp.
|
inline |
Modify learning rate.
Definition at line 156 of file bias_svd_method.hpp.
|
inline |
Apply Collaborative Filtering to the provided data set using the bias SVD.
| 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 73 of file bias_svd_method.hpp.
References BiasSVD< OptimizerType >::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 122 of file bias_svd_method.hpp.
|
inline |
Return predicted rating given user ID and item ID.
| user | User ID. |
| item | Item ID. |
Definition at line 91 of file bias_svd_method.hpp.
|
inline |
Get predicted ratings for a user.
| user | User ID. |
| rating | Resulting rating vector. |
Definition at line 104 of file bias_svd_method.hpp.
|
inline |
Get the User Matrix.
Definition at line 142 of file bias_svd_method.hpp.
|
inline |
Get regularization parameter.
Definition at line 159 of file bias_svd_method.hpp.
|
inline |
Modify regularization parameter.
Definition at line 161 of file bias_svd_method.hpp.
|
inline |
Get the number of iterations.
Definition at line 149 of file bias_svd_method.hpp.
|
inline |
Modify the number of iterations.
Definition at line 151 of file bias_svd_method.hpp.
|
inline |
Get the Item Bias Vector.
Definition at line 146 of file bias_svd_method.hpp.
|
inline |
Get the User Bias Vector.
Definition at line 144 of file bias_svd_method.hpp.
|
inline |
Serialization.
Definition at line 167 of file bias_svd_method.hpp.
|
inline |
Get the Item Matrix.
Definition at line 140 of file bias_svd_method.hpp.