13 #ifndef MLPACK_METHODS_CF_CF_MODEL_HPP 14 #define MLPACK_METHODS_CF_CF_MODEL_HPP 17 #include <boost/variant.hpp> 45 template <
typename DecompositionPolicy,
57 template <
typename DecompositionPolicy,
66 template <
typename NeighborSearchPolicy,
67 typename InterpolationPolicy>
72 const arma::Mat<size_t>& combinations;
74 arma::vec& predictions;
78 template <
typename DecompositionPolicy,
84 arma::vec& predictions);
91 template <
typename NeighborSearchPolicy,
92 typename InterpolationPolicy>
99 arma::Mat<size_t>& recommendations;
101 const arma::Col<size_t>& users;
103 const bool usersGiven;
108 arma::Mat<size_t>& recommendations,
109 const arma::Col<size_t>& users,
110 const bool usersGiven);
113 template <
typename DecompositionPolicy,
130 boost::variant<CFType<NMFPolicy, NoNormalization>*,
183 template <
typename DecompositionPolicy,
188 template<
typename DecompositionPolicy,
190 void Train(
const MatType& data,
191 const size_t numUsersForSimilarity,
193 const size_t maxIterations,
194 const double minResidue,
196 const std::string& normalizationType =
"none");
199 template <
typename NeighborSearchPolicy,
200 typename InterpolationPolicy>
201 void Predict(
const arma::Mat<size_t>& combinations,
202 arma::vec& predictions);
205 template<
typename NeighborSearchPolicy,
206 typename InterpolationPolicy>
207 void GetRecommendations(
const size_t numRecs,
208 arma::Mat<size_t>& recommendations,
209 const arma::Col<size_t>& users);
212 template<
typename NeighborSearchPolicy,
213 typename InterpolationPolicy>
214 void GetRecommendations(
const size_t numRecs,
215 arma::Mat<size_t>& recommendations);
218 template<
typename Archive>
219 void serialize(Archive& ar,
const unsigned int );
226 #include "cf_model_impl.hpp"
RecommendationVisitor uses the CFType object to get recommendations for the given users...
PredictVisitor uses the CFType object to make predictions on the given combinations of users and item...
This normalization class doesn't perform any normalization.
DeleteVisitor deletes the CFType<> object which is pointed to by the variable cf in class CFModel...
The model to save to disk.
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
GetValueVisitor returns the pointer which points to the CFType object.
CFModel()
Create an empty CF model.
This class implements Collaborative Filtering (CF).
void operator()(CFType< DecompositionPolicy, NormalizationType > *c) const
Delete CFType object.