\section{Randomized\+S\+VD Class Reference}
\label{classmlpack_1_1svd_1_1RandomizedSVD}\index{Randomized\+S\+VD@{Randomized\+S\+VD}}


Randomized S\+VD is a matrix factorization that is based on randomized matrix approximation techniques, developed in in \char`\"{}\+Finding structure with randomness\+:
\+Probabilistic algorithms for constructing approximate matrix decompositions\char`\"{}.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Randomized\+S\+VD} (const arma\+::mat \&data, arma\+::mat \&u, arma\+::vec \&s, arma\+::mat \&v, const size\+\_\+t iterated\+Power=0, const size\+\_\+t max\+Iterations=2, const size\+\_\+t rank=0, const double eps=1e-\/7)
\begin{DoxyCompactList}\small\item\em Create object for the randomized S\+VD method. \end{DoxyCompactList}\item 
\textbf{ Randomized\+S\+VD} (const size\+\_\+t iterated\+Power=0, const size\+\_\+t max\+Iterations=2, const double eps=1e-\/7)
\begin{DoxyCompactList}\small\item\em Create object for the randomized S\+VD method. \end{DoxyCompactList}\item 
void \textbf{ Apply} (const arma\+::sp\+\_\+mat \&data, arma\+::mat \&u, arma\+::vec \&s, arma\+::mat \&v, const size\+\_\+t rank)
\begin{DoxyCompactList}\small\item\em Center the data to apply Principal Component Analysis on given sparse matrix dataset using randomized S\+VD. \end{DoxyCompactList}\item 
void \textbf{ Apply} (const arma\+::mat \&data, arma\+::mat \&u, arma\+::vec \&s, arma\+::mat \&v, const size\+\_\+t rank)
\begin{DoxyCompactList}\small\item\em Center the data to apply Principal Component Analysis on given matrix dataset using randomized S\+VD. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Apply} (const Mat\+Type \&data, arma\+::mat \&u, arma\+::vec \&s, arma\+::mat \&v, const size\+\_\+t rank, Mat\+Type row\+Mean)
\begin{DoxyCompactList}\small\item\em Apply Principal Component Analysis to the provided matrix data set using the randomized S\+VD. \end{DoxyCompactList}\item 
double \textbf{ Epsilon} () const
\begin{DoxyCompactList}\small\item\em Get the value used for decomposition stability. \end{DoxyCompactList}\item 
double \& \textbf{ Epsilon} ()
\begin{DoxyCompactList}\small\item\em Modify the value used for decomposition stability. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Iterated\+Power} () const
\begin{DoxyCompactList}\small\item\em Get the size of the normalized power iterations. \end{DoxyCompactList}\item 
size\+\_\+t \& \textbf{ Iterated\+Power} ()
\begin{DoxyCompactList}\small\item\em Modify the size of the normalized power iterations. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Max\+Iterations} () const
\begin{DoxyCompactList}\small\item\em Get the number of iterations for the power method. \end{DoxyCompactList}\item 
size\+\_\+t \& \textbf{ Max\+Iterations} ()
\begin{DoxyCompactList}\small\item\em Modify the number of iterations for the power method. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Randomized S\+VD is a matrix factorization that is based on randomized matrix approximation techniques, developed in in \char`\"{}\+Finding structure with randomness\+:
\+Probabilistic algorithms for constructing approximate matrix decompositions\char`\"{}. 

For more information, see the following.


\begin{DoxyCode}
@article\{Halko2011,
  author  = \{Halko, N. and Martinsson, P. G. and Tropp, J. A.\},
  title   = \{Finding Structure with Randomness: Probabilistic Algorithms \textcolor{keywordflow}{for}
             Constructing Approximate Matrix Decompositions\},
  journal = \{SIAM Rev.\},
  volume  = \{53\},
  year    = \{2011\},
\}
\end{DoxyCode}



\begin{DoxyCode}
@article\{Szlam2014,
  author  = \{Arthur Szlam Yuval Kluger and Mark Tygert\},
  title   = \{An implementation of a randomized algorithm \textcolor{keywordflow}{for} principal
             component analysis\},
  journal = \{CoRR\},
  volume  = \{abs/1412.3510\},
  year    = \{2014\},
\}
\end{DoxyCode}


An example of how to use the interface is shown below\+:


\begin{DoxyCode}
arma::mat data; \textcolor{comment}{// Rating data in the form of coordinate list.}

\textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} rank = 20; \textcolor{comment}{// Rank used for the decomposition.}

\textcolor{comment}{// Make a RandomizedSVD object.}
RandomizedSVD rSVD();

arma::mat u, s, v;

\textcolor{comment}{// Use the Apply() method to get a factorization.}
rSVD.Apply(data, u, s, v, rank);
\end{DoxyCode}
 

Definition at line 66 of file randomized\+\_\+svd.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_af70e8f0a731005cb119a615c99057f66}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Randomized\+S\+VD@{Randomized\+S\+VD}}
\index{Randomized\+S\+VD@{Randomized\+S\+VD}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Randomized\+S\+V\+D()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \textbf{ Randomized\+S\+VD} (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{data,  }\item[{arma\+::mat \&}]{u,  }\item[{arma\+::vec \&}]{s,  }\item[{arma\+::mat \&}]{v,  }\item[{const size\+\_\+t}]{iterated\+Power = {\ttfamily 0},  }\item[{const size\+\_\+t}]{max\+Iterations = {\ttfamily 2},  }\item[{const size\+\_\+t}]{rank = {\ttfamily 0},  }\item[{const double}]{eps = {\ttfamily 1e-\/7} }\end{DoxyParamCaption})}



Create object for the randomized S\+VD method. 


\begin{DoxyParams}{Parameters}
{\em data} & Data matrix. \\
\hline
{\em u} & First unitary matrix. \\
\hline
{\em v} & Second unitary matrix. \\
\hline
{\em sigma} & Diagonal matrix of singular values. \\
\hline
{\em iterated\+Power} & Size of the normalized power iterations (Default\+: rank + 2). \\
\hline
{\em max\+Iterations} & Number of iterations for the power method (Default\+: 2). \\
\hline
{\em rank} & Rank of the approximation (Default\+: number of rows.) \\
\hline
{\em eps} & The eps coefficient to avoid division by zero (numerical stability). \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_aade248977ba80c862ec357d2c33f5ddf}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Randomized\+S\+VD@{Randomized\+S\+VD}}
\index{Randomized\+S\+VD@{Randomized\+S\+VD}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Randomized\+S\+V\+D()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \textbf{ Randomized\+S\+VD} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{iterated\+Power = {\ttfamily 0},  }\item[{const size\+\_\+t}]{max\+Iterations = {\ttfamily 2},  }\item[{const double}]{eps = {\ttfamily 1e-\/7} }\end{DoxyParamCaption})}



Create object for the randomized S\+VD method. 


\begin{DoxyParams}{Parameters}
{\em iterated\+Power} & Size of the normalized power iterations (Default\+: rank + 2). \\
\hline
{\em max\+Iterations} & Number of iterations for the power method (Default\+: 2). \\
\hline
{\em eps} & The eps coefficient to avoid division by zero (numerical stability). \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_ab1a789d5811597b03ad838edcfab055a}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Apply@{Apply}}
\index{Apply@{Apply}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Apply()\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily void Apply (\begin{DoxyParamCaption}\item[{const arma\+::sp\+\_\+mat \&}]{data,  }\item[{arma\+::mat \&}]{u,  }\item[{arma\+::vec \&}]{s,  }\item[{arma\+::mat \&}]{v,  }\item[{const size\+\_\+t}]{rank }\end{DoxyParamCaption})}



Center the data to apply Principal Component Analysis on given sparse matrix dataset using randomized S\+VD. 


\begin{DoxyParams}{Parameters}
{\em data} & Sparse data matrix. \\
\hline
{\em u} & First unitary matrix. \\
\hline
{\em v} & Second unitary matrix. \\
\hline
{\em sigma} & Diagonal matrix of singular values. \\
\hline
{\em rank} & Rank of the approximation. \\
\hline
\end{DoxyParams}


Referenced by Randomized\+S\+V\+D\+Policy\+::\+Apply().

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_a880f86693b7d486206c2f69ad8d9c59a}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Apply@{Apply}}
\index{Apply@{Apply}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Apply()\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily void Apply (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{data,  }\item[{arma\+::mat \&}]{u,  }\item[{arma\+::vec \&}]{s,  }\item[{arma\+::mat \&}]{v,  }\item[{const size\+\_\+t}]{rank }\end{DoxyParamCaption})}



Center the data to apply Principal Component Analysis on given matrix dataset using randomized S\+VD. 


\begin{DoxyParams}{Parameters}
{\em data} & Data matrix. \\
\hline
{\em u} & First unitary matrix. \\
\hline
{\em v} & Second unitary matrix. \\
\hline
{\em sigma} & Diagonal matrix of singular values. \\
\hline
{\em rank} & Rank of the approximation. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_adf076c4f0e7c5f7587da9a00f656e5b2}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Apply@{Apply}}
\index{Apply@{Apply}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Apply()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily void Apply (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{arma\+::mat \&}]{u,  }\item[{arma\+::vec \&}]{s,  }\item[{arma\+::mat \&}]{v,  }\item[{const size\+\_\+t}]{rank,  }\item[{Mat\+Type}]{row\+Mean }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Apply Principal Component Analysis to the provided matrix data set using the randomized S\+VD. 


\begin{DoxyParams}{Parameters}
{\em data} & Data matrix. \\
\hline
{\em u} & First unitary matrix. \\
\hline
{\em v} & Second unitary matrix. \\
\hline
{\em sigma} & Diagonal matrix of singular values. \\
\hline
{\em rank} & Rank of the approximation. \\
\hline
{\em row\+Mean} & Centered mean value matrix. \\
\hline
\end{DoxyParams}


Definition at line 151 of file randomized\+\_\+svd.\+hpp.

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_af6d960193bb5db37e51416e12bf720de}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Epsilon@{Epsilon}}
\index{Epsilon@{Epsilon}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Epsilon()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Epsilon (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the value used for decomposition stability. 



Definition at line 245 of file randomized\+\_\+svd.\+hpp.

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_ab6a080993b32456443eced5df2f8b9b9}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Epsilon@{Epsilon}}
\index{Epsilon@{Epsilon}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Epsilon()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Epsilon (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the value used for decomposition stability. 



Definition at line 247 of file randomized\+\_\+svd.\+hpp.

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_aa8e59edf3732bcceec0a214f9d049488}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Iterated\+Power@{Iterated\+Power}}
\index{Iterated\+Power@{Iterated\+Power}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Iterated\+Power()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily size\+\_\+t Iterated\+Power (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the size of the normalized power iterations. 



Definition at line 235 of file randomized\+\_\+svd.\+hpp.

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_aa06eded3fc0ec2f6bae88acc0395da57}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Iterated\+Power@{Iterated\+Power}}
\index{Iterated\+Power@{Iterated\+Power}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Iterated\+Power()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily size\+\_\+t\& Iterated\+Power (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the size of the normalized power iterations. 



Definition at line 237 of file randomized\+\_\+svd.\+hpp.

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_a420770944a5b0c7a852c4ec372c4a2d1}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Max\+Iterations@{Max\+Iterations}}
\index{Max\+Iterations@{Max\+Iterations}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Max\+Iterations()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily size\+\_\+t Max\+Iterations (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of iterations for the power method. 



Definition at line 240 of file randomized\+\_\+svd.\+hpp.

\mbox{\label{classmlpack_1_1svd_1_1RandomizedSVD_acda675ab4ab86b95c92bc33bc391a61b}} 
\index{mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}!Max\+Iterations@{Max\+Iterations}}
\index{Max\+Iterations@{Max\+Iterations}!mlpack\+::svd\+::\+Randomized\+S\+VD@{mlpack\+::svd\+::\+Randomized\+S\+VD}}
\subsubsection{Max\+Iterations()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily size\+\_\+t\& Max\+Iterations (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the number of iterations for the power method. 



Definition at line 242 of file randomized\+\_\+svd.\+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/randomized\+\_\+svd/\textbf{ randomized\+\_\+svd.\+hpp}\end{DoxyCompactItemize}
