12 #ifndef MLPACK_METHODS_CF_CF_MODEL_HPP 13 #define MLPACK_METHODS_CF_CF_MODEL_HPP 16 #include <boost/variant.hpp> 38 template<
typename DecompositionPolicy>
49 template<
typename DecompositionPolicy>
57 template <
typename NeighborSearchPolicy,
58 typename InterpolationPolicy>
63 const arma::Mat<size_t>& combinations;
65 arma::vec& predictions;
69 template<
typename DecompositionPolicy>
74 arma::vec& predictions);
81 template <
typename NeighborSearchPolicy,
82 typename InterpolationPolicy>
89 arma::Mat<size_t>& recommendations;
91 const arma::Col<size_t>& users;
93 const bool usersGiven;
98 arma::Mat<size_t>& recommendations,
99 const arma::Col<size_t>& users,
100 const bool usersGiven);
103 template<
typename DecompositionPolicy>
118 boost::variant<CFType<NMFPolicy>*,
135 template<
typename DecompositionPolicy>
139 template<
typename DecompositionPolicy,
141 void Train(
const MatType& data,
142 const size_t numUsersForSimilarity,
144 const size_t maxIterations,
145 const double minResidue,
149 template <
typename NeighborSearchPolicy,
150 typename InterpolationPolicy>
151 void Predict(
const arma::Mat<size_t>& combinations,
152 arma::vec& predictions);
155 template<
typename NeighborSearchPolicy,
156 typename InterpolationPolicy>
157 void GetRecommendations(
const size_t numRecs,
158 arma::Mat<size_t>& recommendations,
159 const arma::Col<size_t>& users);
162 template<
typename NeighborSearchPolicy,
163 typename InterpolationPolicy>
164 void GetRecommendations(
const size_t numRecs,
165 arma::Mat<size_t>& recommendations);
168 template<
typename Archive>
169 void serialize(Archive& ar,
const unsigned int );
176 #include "cf_model_impl.hpp" void operator()(CFType< DecompositionPolicy > *c) const
Delete CFType object.
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...
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).