\section{C\+F\+Model Class Reference}
\label{classmlpack_1_1cf_1_1CFModel}\index{C\+F\+Model@{C\+F\+Model}}


The model to save to disk.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ C\+F\+Model} ()
\begin{DoxyCompactList}\small\item\em Create an empty CF model. \end{DoxyCompactList}\item 
\textbf{ $\sim$\+C\+F\+Model} ()
\begin{DoxyCompactList}\small\item\em Clean up memory. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Decomposition\+Policy , typename Normalization\+Type  = No\+Normalization$>$ }\\const \textbf{ C\+F\+Type}$<$ Decomposition\+Policy, Normalization\+Type $>$ $\ast$ \textbf{ C\+F\+Ptr} () const
\begin{DoxyCompactList}\small\item\em Get the pointer to C\+F\+Type$<$$>$ object. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Neighbor\+Search\+Policy , typename Interpolation\+Policy $>$ }\\void \textbf{ Get\+Recommendations} (const size\+\_\+t num\+Recs, arma\+::\+Mat$<$ size\+\_\+t $>$ \&recommendations, const arma\+::\+Col$<$ size\+\_\+t $>$ \&users)
\begin{DoxyCompactList}\small\item\em Compute recommendations for query users. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Neighbor\+Search\+Policy , typename Interpolation\+Policy $>$ }\\void \textbf{ Get\+Recommendations} (const size\+\_\+t num\+Recs, arma\+::\+Mat$<$ size\+\_\+t $>$ \&recommendations)
\begin{DoxyCompactList}\small\item\em Compute recommendations for all users. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Neighbor\+Search\+Policy , typename Interpolation\+Policy $>$ }\\void \textbf{ Predict} (const arma\+::\+Mat$<$ size\+\_\+t $>$ \&combinations, arma\+::vec \&predictions)
\begin{DoxyCompactList}\small\item\em Make predictions. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the model. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Decomposition\+Policy , typename Mat\+Type $>$ }\\void \textbf{ Train} (const Mat\+Type \&data, const size\+\_\+t num\+Users\+For\+Similarity, const size\+\_\+t rank, const size\+\_\+t max\+Iterations, const double min\+Residue, const bool mit, const std\+::string \&normalization\+Type=\char`\"{}none\char`\"{})
\begin{DoxyCompactList}\small\item\em Train the model. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The model to save to disk. 

Definition at line 121 of file cf\+\_\+model.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1cf_1_1CFModel_a169ddef56c31cadd9b363be262d60ba3}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!C\+F\+Model@{C\+F\+Model}}
\index{C\+F\+Model@{C\+F\+Model}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{C\+F\+Model()}
{\footnotesize\ttfamily \textbf{ C\+F\+Model} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create an empty CF model. 



Definition at line 177 of file cf\+\_\+model.\+hpp.

\mbox{\label{classmlpack_1_1cf_1_1CFModel_a55bf85a1a0bd1caa9437867a386cd4d3}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!````~C\+F\+Model@{$\sim$\+C\+F\+Model}}
\index{````~C\+F\+Model@{$\sim$\+C\+F\+Model}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{$\sim$\+C\+F\+Model()}
{\footnotesize\ttfamily $\sim$\textbf{ C\+F\+Model} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clean up memory. 



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1cf_1_1CFModel_a8a5f3d0bdb77c408efe6f1258c4e410d}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!C\+F\+Ptr@{C\+F\+Ptr}}
\index{C\+F\+Ptr@{C\+F\+Ptr}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{C\+F\+Ptr()}
{\footnotesize\ttfamily const \textbf{ C\+F\+Type}$<$Decomposition\+Policy, Normalization\+Type$>$$\ast$ C\+F\+Ptr (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Get the pointer to C\+F\+Type$<$$>$ object. 

\mbox{\label{classmlpack_1_1cf_1_1CFModel_a07ca697e6ba5cf1b7056071914e708a1}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!Get\+Recommendations@{Get\+Recommendations}}
\index{Get\+Recommendations@{Get\+Recommendations}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{Get\+Recommendations()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Get\+Recommendations (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{num\+Recs,  }\item[{arma\+::\+Mat$<$ size\+\_\+t $>$ \&}]{recommendations,  }\item[{const arma\+::\+Col$<$ size\+\_\+t $>$ \&}]{users }\end{DoxyParamCaption})}



Compute recommendations for query users. 

\mbox{\label{classmlpack_1_1cf_1_1CFModel_aea00d8c8dfad713dd5542e450d633d5a}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!Get\+Recommendations@{Get\+Recommendations}}
\index{Get\+Recommendations@{Get\+Recommendations}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{Get\+Recommendations()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Get\+Recommendations (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{num\+Recs,  }\item[{arma\+::\+Mat$<$ size\+\_\+t $>$ \&}]{recommendations }\end{DoxyParamCaption})}



Compute recommendations for all users. 

\mbox{\label{classmlpack_1_1cf_1_1CFModel_a3954ffd1847fce73b06f6096cb98857d}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!Predict@{Predict}}
\index{Predict@{Predict}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{Predict()}
{\footnotesize\ttfamily void Predict (\begin{DoxyParamCaption}\item[{const arma\+::\+Mat$<$ size\+\_\+t $>$ \&}]{combinations,  }\item[{arma\+::vec \&}]{predictions }\end{DoxyParamCaption})}



Make predictions. 

\mbox{\label{classmlpack_1_1cf_1_1CFModel_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the model. 

\mbox{\label{classmlpack_1_1cf_1_1CFModel_ac7c734703c06fdfe30b6d6f3fa97d5f9}} 
\index{mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}!Train@{Train}}
\index{Train@{Train}!mlpack\+::cf\+::\+C\+F\+Model@{mlpack\+::cf\+::\+C\+F\+Model}}
\subsubsection{Train()}
{\footnotesize\ttfamily void Train (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{const size\+\_\+t}]{num\+Users\+For\+Similarity,  }\item[{const size\+\_\+t}]{rank,  }\item[{const size\+\_\+t}]{max\+Iterations,  }\item[{const double}]{min\+Residue,  }\item[{const bool}]{mit,  }\item[{const std\+::string \&}]{normalization\+Type = {\ttfamily \char`\"{}none\char`\"{}} }\end{DoxyParamCaption})}



Train the model. 



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/3.\+3.\+2/src/mlpack/methods/cf/\textbf{ cf\+\_\+model.\+hpp}\end{DoxyCompactItemize}
