mlpack
Public Types | Public Member Functions | List of all members
mlpack::cf::CFModel Class Reference

The model to save to disk. More...

#include <cf_model.hpp>

Public Types

enum  DecompositionTypes {
  NMF, BATCH_SVD, RANDOMIZED_SVD, REG_SVD,
  SVD_COMPLETE, SVD_INCOMPLETE, BIAS_SVD, SVD_PLUS_PLUS
}
 
enum  NormalizationTypes {
  NO_NORMALIZATION, ITEM_MEAN_NORMALIZATION, USER_MEAN_NORMALIZATION, OVERALL_MEAN_NORMALIZATION,
  Z_SCORE_NORMALIZATION
}
 

Public Member Functions

 CFModel ()
 Create an empty CF model.
 
 CFModel (const CFModel &other)
 Create a CF model by copying the given model.
 
 CFModel (CFModel &&other)
 Create a CF model by taking ownership of the data of the other model.
 
CFModeloperator= (const CFModel &other)
 Make this CF model a copy of the other model.
 
CFModeloperator= (CFModel &&other)
 Make this CF model take ownership of the data of the other model.
 
 ~CFModel ()
 Clean up memory.
 
CFWrapperBaseCF () const
 Get the CFWrapperBase object. (Be careful!)
 
const DecompositionTypes & DecompositionType () const
 Get the decomposition type.
 
DecompositionTypes & DecompositionType ()
 Set the decomposition type.
 
const NormalizationTypes & NormalizationType () const
 Get the normalization type.
 
NormalizationTypes & NormalizationType ()
 Set the normalization type.
 
void Train (const arma::mat &data, const size_t numUsersForSimilarity, const size_t rank, const size_t maxIterations, const double minResidue, const bool mit)
 Train the model.
 
void Predict (const NeighborSearchTypes nsType, const InterpolationTypes interpolationType, const arma::Mat< size_t > &combinations, arma::vec &predictions)
 Make predictions.
 
void GetRecommendations (const NeighborSearchTypes nsType, const InterpolationTypes interpolationType, const size_t numRecs, arma::Mat< size_t > &recommendations, const arma::Col< size_t > &users)
 Compute recommendations for query users. More...
 
void GetRecommendations (const NeighborSearchTypes nsType, const InterpolationTypes interpolationType, const size_t numRecs, arma::Mat< size_t > &recommendations)
 Compute recommendations for all users.
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the model.
 

Detailed Description

The model to save to disk.

Member Function Documentation

◆ GetRecommendations()

void mlpack::cf::CFModel::GetRecommendations ( const NeighborSearchTypes  nsType,
const InterpolationTypes  interpolationType,
const size_t  numRecs,
arma::Mat< size_t > &  recommendations,
const arma::Col< size_t > &  users 
)

Compute recommendations for query users.

Compute recommendations for queried users.


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