\section{S\+V\+D\+Complete\+Policy Class Reference}
\label{classmlpack_1_1cf_1_1SVDCompletePolicy}\index{S\+V\+D\+Complete\+Policy@{S\+V\+D\+Complete\+Policy}}


Implementation of the S\+VD complete incremental policy to act as a wrapper when accessing S\+VD complete decomposition from within \doxyref{C\+F\+Type}{p.}{classmlpack_1_1cf_1_1CFType}.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Apply} (const Mat\+Type \&, const arma\+::sp\+\_\+mat \&cleaned\+Data, const size\+\_\+t rank, const size\+\_\+t max\+Iterations, const double min\+Residue, const bool mit)
\begin{DoxyCompactList}\small\item\em Apply Collaborative Filtering to the provided data set using the S\+VD complete incremental policy. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Neighbor\+Search\+Policy $>$ }\\void \textbf{ Get\+Neighborhood} (const arma\+::\+Col$<$ size\+\_\+t $>$ \&users, const size\+\_\+t num\+Users\+For\+Similarity, arma\+::\+Mat$<$ size\+\_\+t $>$ \&neighborhood, arma\+::mat \&similarities) const
\begin{DoxyCompactList}\small\item\em Get the neighborhood and corresponding similarities for a set of users. \end{DoxyCompactList}\item 
double \textbf{ Get\+Rating} (const size\+\_\+t user, const size\+\_\+t item) const
\begin{DoxyCompactList}\small\item\em Return predicted rating given user ID and item ID. \end{DoxyCompactList}\item 
void \textbf{ Get\+Rating\+Of\+User} (const size\+\_\+t user, arma\+::vec \&rating) const
\begin{DoxyCompactList}\small\item\em Get predicted ratings for a user. \end{DoxyCompactList}\item 
const arma\+::mat \& \textbf{ H} () const
\begin{DoxyCompactList}\small\item\em Get the User Matrix. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialization. \end{DoxyCompactList}\item 
const arma\+::mat \& \textbf{ W} () const
\begin{DoxyCompactList}\small\item\em Get the Item Matrix. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Implementation of the S\+VD complete incremental policy to act as a wrapper when accessing S\+VD complete decomposition from within \doxyref{C\+F\+Type}{p.}{classmlpack_1_1cf_1_1CFType}. 

An example of how to use \doxyref{S\+V\+D\+Complete\+Policy}{p.}{classmlpack_1_1cf_1_1SVDCompletePolicy} in CF is shown below\+:


\begin{DoxyCode}
\textcolor{keyword}{extern} arma::mat data; \textcolor{comment}{// data is a (user, item, rating) table.}
\textcolor{comment}{// Users for whom recommendations are generated.}
\textcolor{keyword}{extern} arma::Col<size\_t> users;
arma::Mat<size\_t> recommendations; \textcolor{comment}{// Resulting recommendations.}

CFType<SVDCompletePolicy> cf(data);

\textcolor{comment}{// Generate 10 recommendations for all users.}
cf.GetRecommendations(10, recommendations);
\end{DoxyCode}
 

Definition at line 44 of file svd\+\_\+complete\+\_\+method.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_a55d1dc4a735516d3138feb7687552721}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!Apply@{Apply}}
\index{Apply@{Apply}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{Apply()}
{\footnotesize\ttfamily void Apply (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{,  }\item[{const arma\+::sp\+\_\+mat \&}]{cleaned\+Data,  }\item[{const size\+\_\+t}]{rank,  }\item[{const size\+\_\+t}]{max\+Iterations,  }\item[{const double}]{min\+Residue,  }\item[{const bool}]{mit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Apply Collaborative Filtering to the provided data set using the S\+VD complete incremental policy. 


\begin{DoxyParams}{Parameters}
{\em data} & Data matrix\+: dense matrix (coordinate lists) or sparse matrix(cleaned). \\
\hline
{\em cleaned\+Data} & item user table in form of sparse matrix. \\
\hline
{\em rank} & Rank parameter for matrix factorization. \\
\hline
{\em max\+Iterations} & Maximum number of iterations. \\
\hline
{\em min\+Residue} & Residue required to terminate. \\
\hline
{\em mit} & Whether to terminate only when max\+Iterations is reached. \\
\hline
\end{DoxyParams}


Definition at line 60 of file svd\+\_\+complete\+\_\+method.\+hpp.



References A\+M\+F$<$ Termination\+Policy\+Type, Initialization\+Rule\+Type, Update\+Rule\+Type $>$\+::\+Apply().

\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_a35bca7a6e09f4fb35b9945a9368711e4}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!Get\+Neighborhood@{Get\+Neighborhood}}
\index{Get\+Neighborhood@{Get\+Neighborhood}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{Get\+Neighborhood()}
{\footnotesize\ttfamily void Get\+Neighborhood (\begin{DoxyParamCaption}\item[{const arma\+::\+Col$<$ size\+\_\+t $>$ \&}]{users,  }\item[{const size\+\_\+t}]{num\+Users\+For\+Similarity,  }\item[{arma\+::\+Mat$<$ size\+\_\+t $>$ \&}]{neighborhood,  }\item[{arma\+::mat \&}]{similarities }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the neighborhood and corresponding similarities for a set of users. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Neighbor\+Search\+Policy} & The policy to perform neighbor search.\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em users} & Users whose neighborhood is to be computed. \\
\hline
{\em num\+Users\+For\+Similarity} & The number of neighbors returned for each user. \\
\hline
{\em neighborhood} & Neighbors represented by user I\+Ds. \\
\hline
{\em similarities} & Similarity between each user and each of its neighbors. \\
\hline
\end{DoxyParams}


Definition at line 126 of file svd\+\_\+complete\+\_\+method.\+hpp.

\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_a0c3e16d73c8b25b8934cbc36ac161619}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!Get\+Rating@{Get\+Rating}}
\index{Get\+Rating@{Get\+Rating}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{Get\+Rating()}
{\footnotesize\ttfamily double Get\+Rating (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{user,  }\item[{const size\+\_\+t}]{item }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return predicted rating given user ID and item ID. 


\begin{DoxyParams}{Parameters}
{\em user} & User ID. \\
\hline
{\em item} & Item ID. \\
\hline
\end{DoxyParams}


Definition at line 96 of file svd\+\_\+complete\+\_\+method.\+hpp.

\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_ae5dc3895f0294bf054cb2ea58084a426}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!Get\+Rating\+Of\+User@{Get\+Rating\+Of\+User}}
\index{Get\+Rating\+Of\+User@{Get\+Rating\+Of\+User}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{Get\+Rating\+Of\+User()}
{\footnotesize\ttfamily void Get\+Rating\+Of\+User (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{user,  }\item[{arma\+::vec \&}]{rating }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get predicted ratings for a user. 


\begin{DoxyParams}{Parameters}
{\em user} & User ID. \\
\hline
{\em rating} & Resulting rating vector. \\
\hline
\end{DoxyParams}


Definition at line 108 of file svd\+\_\+complete\+\_\+method.\+hpp.

\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_a71e6a6119b9efde17f4112c6d82d9233}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!H@{H}}
\index{H@{H}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{H()}
{\footnotesize\ttfamily const arma\+::mat\& H (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the User Matrix. 



Definition at line 155 of file svd\+\_\+complete\+\_\+method.\+hpp.

\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Serialization. 



Definition at line 161 of file svd\+\_\+complete\+\_\+method.\+hpp.

\mbox{\label{classmlpack_1_1cf_1_1SVDCompletePolicy_a0f733dde66e23287758de984b5151e36}} 
\index{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}!W@{W}}
\index{W@{W}!mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy@{mlpack\+::cf\+::\+S\+V\+D\+Complete\+Policy}}
\subsubsection{W()}
{\footnotesize\ttfamily const arma\+::mat\& W (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the Item Matrix. 



Definition at line 153 of file svd\+\_\+complete\+\_\+method.\+hpp.



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.\+1/src/mlpack/methods/cf/decomposition\+\_\+policies/\textbf{ svd\+\_\+complete\+\_\+method.\+hpp}\end{DoxyCompactItemize}
