This normalization class performs item mean normalization on raw ratings.
More...
#include <item_mean_normalization.hpp>
|
| | ItemMeanNormalization () |
| |
| void | Denormalize (const arma::Mat< size_t > &combinations, arma::vec &predictions) const |
| | Denormalize computed rating by adding item mean. More...
|
| |
| double | Denormalize (const size_t, const size_t item, const double rating) const |
| | Denormalize computed rating by adding item mean. More...
|
| |
| const arma::vec & | Mean () const |
| | Return item mean. More...
|
| |
| void | Normalize (arma::mat &data) |
| | Normalize the data by subtracting item mean from each of existing ratings. More...
|
| |
| void | Normalize (arma::sp_mat &cleanedData) |
| | Normalize the data by subtracting item mean from each of existing ratings. More...
|
| |
| template<typename Archive > |
| void | serialize (Archive &ar, const unsigned int) |
| | Serialization. More...
|
| |
This normalization class performs item mean normalization on raw ratings.
An example of how to use ItemMeanNormalization in CF is shown below:
extern arma::mat data;
extern arma::Col<size_t> users;
arma::Mat<size_t> recommendations;
cf.GetRecommendations(10, recommendations);
This class implements Collaborative Filtering (CF).
Definition at line 39 of file item_mean_normalization.hpp.
◆ ItemMeanNormalization()
◆ Denormalize() [1/2]
| void Denormalize |
( |
const arma::Mat< size_t > & |
combinations, |
|
|
arma::vec & |
predictions |
|
) |
| const |
|
inline |
Denormalize computed rating by adding item mean.
- Parameters
-
| combinations | User/Item combinations. |
| predictions | Predicted ratings for each user/item combination. |
Definition at line 143 of file item_mean_normalization.hpp.
◆ Denormalize() [2/2]
| double Denormalize |
( |
const |
size_t, |
|
|
const size_t |
item, |
|
|
const double |
rating |
|
) |
| const |
|
inline |
Denormalize computed rating by adding item mean.
- Parameters
-
| * | (user) User ID. |
| item | Item ID. |
| rating | Computed rating before denormalization. |
Definition at line 130 of file item_mean_normalization.hpp.
◆ Mean()
| const arma::vec & Mean |
( |
| ) |
const |
|
inline |
◆ Normalize() [1/2]
| void Normalize |
( |
arma::mat & |
data | ) |
|
|
inline |
Normalize the data by subtracting item mean from each of existing ratings.
- Parameters
-
| data | Input dataset in the form of coordinate list. |
Definition at line 50 of file item_mean_normalization.hpp.
◆ Normalize() [2/2]
| void Normalize |
( |
arma::sp_mat & |
cleanedData | ) |
|
|
inline |
Normalize the data by subtracting item mean from each of existing ratings.
- Parameters
-
| cleanedData | Input data as a sparse matrix. |
Definition at line 90 of file item_mean_normalization.hpp.
◆ serialize()
| void serialize |
( |
Archive & |
ar, |
|
|
const unsigned int |
|
|
) |
| |
|
inline |
The documentation for this class was generated from the following file: