With SimilarityInterpolation, interpolation weights are based on similarities between query user and its neighbors. More...
Public Member Functions | |
SimilarityInterpolation () | |
SimilarityInterpolation (const arma::sp_mat &) | |
This constructor is needed for interface consistency. More... | |
template < typename VectorType , typename DecompositionPolicy > | |
void | GetWeights (VectorType &&weights, const DecompositionPolicy &, const size_t, const arma::Col< size_t > &neighbors, const arma::vec &similarities, const arma::sp_mat &) |
Interpolation weights are computed as normalized similarities. More... | |
With SimilarityInterpolation, interpolation weights are based on similarities between query user and its neighbors.
All interpolation weights sum up to one.
An example of how to use SimilarityInterpolation in CF is shown below:
Definition at line 41 of file similarity_interpolation.hpp.
|
inline |
Definition at line 45 of file similarity_interpolation.hpp.
|
inline |
This constructor is needed for interface consistency.
Definition at line 50 of file similarity_interpolation.hpp.
|
inline |
Interpolation weights are computed as normalized similarities.
After getting the weights, CF algorithm multiplies each neighbor's rating by its corresponding weight and sums them to get predicted rating.
weights | Resulting interpolation weights. The size of weights should be set to the number of neighbors before calling GetWeights(). |
* | (decomposition) Decomposition object. |
* | (queryUser) Queried user. |
neighbors | Neighbors of queried user. |
similarities | Similarities between query user and neighbors. |
* | (cleanedData) Sparse rating matrix. |
Definition at line 67 of file similarity_interpolation.hpp.
References Log::Fatal.