Implementation of regression-based interpolation method. More...
Public Member Functions | |
RegressionInterpolation () | |
Empty Constructor. More... | |
RegressionInterpolation (const arma::sp_mat &cleanedData) | |
Use cleanedData to perform necessary preprocessing. More... | |
template < typename VectorType , typename DecompositionPolicy > | |
void | GetWeights (VectorType &&weights, const DecompositionPolicy &decomposition, const size_t queryUser, const arma::Col< size_t > &neighbors, const arma::vec &, const arma::sp_mat &cleanedData) |
The regression-based interpolation problem can be solved by a linear system of equations. More... | |
Implementation of regression-based interpolation method.
Predicting a user's rating by it's neighbors' ratings can be regarded as solving linear regression of on , where v are u's neighbors.
An example of how to use RegressionInterpolation in CF is shown below:
For more information, see the following paper.
Definition at line 56 of file regression_interpolation.hpp.
|
inline |
Empty Constructor.
Definition at line 62 of file regression_interpolation.hpp.
|
inline |
Use cleanedData to perform necessary preprocessing.
cleanedData | Sparse rating matrix. |
Definition at line 69 of file regression_interpolation.hpp.
|
inline |
The regression-based interpolation problem can be solved by a linear system of equations.
This method first calculates the coefficients and constant terms for the equations and then solve the equations. The solution of the linear system of equations is the resulting interpolation weights (the first parameter). 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 95 of file regression_interpolation.hpp.
References Log::Fatal.