CombinedNormalization< NormalizationTypes > Class Template Reference

This normalization class performs a sequence of normalization methods on raw ratings. More...

Public Types

using TupleType = std::tuple< NormalizationTypes... >
 

Public Member Functions

 CombinedNormalization ()
 
double Denormalize (const size_t user, const size_t item, const double rating) const
 Denormalize rating by calling Denormalize() in each normalization object. More...

 
void Denormalize (const arma::Mat< size_t > &combinations, arma::vec &predictions) const
 Denormalize rating by calling Denormalize() in each normalization object. More...

 
const TupleTypeNormalizations () const
 Return normalizations tuple. More...

 
template
<
typename
MatType
>
void Normalize (MatType &data)
 Normalize the data by calling Normalize() in each normalization object. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t version)
 Serialization. More...

 

Detailed Description


template<typename... NormalizationTypes>
class mlpack::cf::CombinedNormalization< NormalizationTypes >

This normalization class performs a sequence of normalization methods on raw ratings.

An example of how to use CombinedNormalization in CF is shown below:

extern arma::mat data; // data is a (user, item, rating) table.
// Users for whom recommendations are generated.
extern arma::Col<size_t> users;
arma::Mat<size_t> recommendations; // Resulting recommendations.
CFType<NMFPolicy,
OverallMeanNormalization,
UserMeanNormalization,
ItemMeanNormalization>> cf(data);
// Generate 10 recommendations for all users.
cf.GetRecommendations(10, recommendations);

Definition at line 44 of file combined_normalization.hpp.

Member Typedef Documentation

◆ TupleType

using TupleType = std::tuple<NormalizationTypes...>

Definition at line 47 of file combined_normalization.hpp.

Constructor & Destructor Documentation

◆ CombinedNormalization()

Definition at line 50 of file combined_normalization.hpp.

Member Function Documentation

◆ Denormalize() [1/2]

double Denormalize ( const size_t  user,
const size_t  item,
const double  rating 
) const
inline

Denormalize rating by calling Denormalize() in each normalization object.

Note that the order of objects calling Denormalize() should be the reversed order of objects calling Normalize().

Parameters
userUser ID.
itemItem ID.
ratingComputed rating before denormalization.

Definition at line 72 of file combined_normalization.hpp.

Referenced by CombinedNormalization< NormalizationTypes >::serialize().

◆ Denormalize() [2/2]

void Denormalize ( const arma::Mat< size_t > &  combinations,
arma::vec &  predictions 
) const
inline

Denormalize rating by calling Denormalize() in each normalization object.

Note that the order of objects calling Denormalize() should be the reversed order of objects calling Normalize().

Parameters
combinationsUser/Item combinations.
predictionsPredicted ratings for each user/item combination.

Definition at line 87 of file combined_normalization.hpp.

◆ Normalizations()

const TupleType& Normalizations ( ) const
inline

Return normalizations tuple.

Definition at line 96 of file combined_normalization.hpp.

◆ Normalize()

void Normalize ( MatType &  data)
inline

Normalize the data by calling Normalize() in each normalization object.

Parameters
dataInput dataset.

Definition at line 58 of file combined_normalization.hpp.

Referenced by CombinedNormalization< NormalizationTypes >::serialize().

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t  version 
)
inline

The documentation for this class was generated from the following file: