\section{P\+C\+A\+Whitening Class Reference}
\label{classmlpack_1_1data_1_1PCAWhitening}\index{P\+C\+A\+Whitening@{P\+C\+A\+Whitening}}


A simple \doxyref{P\+C\+A\+Whitening}{p.}{classmlpack_1_1data_1_1PCAWhitening} class.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ P\+C\+A\+Whitening} (double eps=0.\+00005)
\begin{DoxyCompactList}\small\item\em A constructor to set the regularization parameter. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Eigen\+Values} () const
\begin{DoxyCompactList}\small\item\em Get the eigenvalues vector. \end{DoxyCompactList}\item 
const arma\+::mat \& \textbf{ Eigen\+Vectors} () const
\begin{DoxyCompactList}\small\item\em Get the eigenvector. \end{DoxyCompactList}\item 
const double \& \textbf{ Epsilon} () const
\begin{DoxyCompactList}\small\item\em Get the regularization parameter. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Fit} (const Mat\+Type \&input)
\begin{DoxyCompactList}\small\item\em Function to fit features, to find out the min max and scale. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Inverse\+Transform} (const Mat\+Type \&input, Mat\+Type \&output)
\begin{DoxyCompactList}\small\item\em Function to retrieve original dataset. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Item\+Mean} () const
\begin{DoxyCompactList}\small\item\em Get the mean row vector. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Transform} (const Mat\+Type \&input, Mat\+Type \&output)
\begin{DoxyCompactList}\small\item\em Function for P\+CA whitening. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A simple \doxyref{P\+C\+A\+Whitening}{p.}{classmlpack_1_1data_1_1PCAWhitening} class. 

Whitens a matrix using the eigendecomposition of the covariance matrix. Whitening means the covariance matrix of the result is the identity matrix.

For whitening related formula and more info, check the link below. {\tt http\+://ufldl.\+stanford.\+edu/tutorial/unsupervised/\+P\+C\+A\+Whitening/}


\begin{DoxyCode}
arma::mat input;
Load(\textcolor{stringliteral}{"train.csv"}, input);
arma::mat output;

\textcolor{comment}{// Fit the features.}
PCAWhitening scale;
scale.Fit(input)

\textcolor{comment}{// Scale the features.}
scale.Transform(input, output);

\textcolor{comment}{// Retransform the input.}
scale.InverseTransform(output, input);
\end{DoxyCode}
 

Definition at line 47 of file pca\+\_\+whitening.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a45ec61849c4ad0dfbc18ff0ebc57d1ee}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!P\+C\+A\+Whitening@{P\+C\+A\+Whitening}}
\index{P\+C\+A\+Whitening@{P\+C\+A\+Whitening}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{P\+C\+A\+Whitening()}
{\footnotesize\ttfamily \textbf{ P\+C\+A\+Whitening} (\begin{DoxyParamCaption}\item[{double}]{eps = {\ttfamily 0.00005} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



A constructor to set the regularization parameter. 


\begin{DoxyParams}{Parameters}
{\em eps} & Regularization parameter. \\
\hline
\end{DoxyParams}


Definition at line 55 of file pca\+\_\+whitening.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a5d2e9b59773a10f622f833c406435cf4}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Eigen\+Values@{Eigen\+Values}}
\index{Eigen\+Values@{Eigen\+Values}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Eigen\+Values()}
{\footnotesize\ttfamily const arma\+::vec\& Eigen\+Values (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the eigenvalues vector. 



Definition at line 117 of file pca\+\_\+whitening.\+hpp.



Referenced by Z\+C\+A\+Whitening\+::\+Eigen\+Values(), and Z\+C\+A\+Whitening\+::\+Inverse\+Transform().

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a6a2521e3588c5bb0ff6191c68d97b217}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Eigen\+Vectors@{Eigen\+Vectors}}
\index{Eigen\+Vectors@{Eigen\+Vectors}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Eigen\+Vectors()}
{\footnotesize\ttfamily const arma\+::mat\& Eigen\+Vectors (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the eigenvector. 



Definition at line 119 of file pca\+\_\+whitening.\+hpp.



Referenced by Z\+C\+A\+Whitening\+::\+Eigen\+Vectors(), Z\+C\+A\+Whitening\+::\+Inverse\+Transform(), and Z\+C\+A\+Whitening\+::\+Transform().

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a3ababd597760bb1f9782ad2c17aadb41}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Epsilon@{Epsilon}}
\index{Epsilon@{Epsilon}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Epsilon()}
{\footnotesize\ttfamily const double\& Epsilon (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the regularization parameter. 



Definition at line 121 of file pca\+\_\+whitening.\+hpp.



Referenced by Z\+C\+A\+Whitening\+::\+Epsilon().

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a0b68c1a39a21e56e10f5b9250b056244}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Fit@{Fit}}
\index{Fit@{Fit}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Fit()}
{\footnotesize\ttfamily void Fit (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{input }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Function to fit features, to find out the min max and scale. 


\begin{DoxyParams}{Parameters}
{\em input} & Dataset to fit. \\
\hline
\end{DoxyParams}


Definition at line 71 of file pca\+\_\+whitening.\+hpp.



References mlpack\+::math\+::\+Column\+Covariance().



Referenced by Z\+C\+A\+Whitening\+::\+Fit().

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_afb0e67c6fbf5a527f63469bbbf07066c}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Inverse\+Transform@{Inverse\+Transform}}
\index{Inverse\+Transform@{Inverse\+Transform}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Inverse\+Transform()}
{\footnotesize\ttfamily void Inverse\+Transform (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{input,  }\item[{Mat\+Type \&}]{output }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Function to retrieve original dataset. 


\begin{DoxyParams}{Parameters}
{\em input} & Scaled dataset. \\
\hline
{\em output} & Output matrix with original Dataset. \\
\hline
\end{DoxyParams}


Definition at line 107 of file pca\+\_\+whitening.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a95996a797e721bc9acc0c9a5d697fdcf}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Item\+Mean@{Item\+Mean}}
\index{Item\+Mean@{Item\+Mean}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Item\+Mean()}
{\footnotesize\ttfamily const arma\+::vec\& Item\+Mean (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the mean row vector. 



Definition at line 115 of file pca\+\_\+whitening.\+hpp.



Referenced by Z\+C\+A\+Whitening\+::\+Inverse\+Transform(), and Z\+C\+A\+Whitening\+::\+Item\+Mean().

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 124 of file pca\+\_\+whitening.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1PCAWhitening_a7bc470a1e097f5b0aaf2396691432b3f}} 
\index{mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}!Transform@{Transform}}
\index{Transform@{Transform}!mlpack\+::data\+::\+P\+C\+A\+Whitening@{mlpack\+::data\+::\+P\+C\+A\+Whitening}}
\subsubsection{Transform()}
{\footnotesize\ttfamily void Transform (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{input,  }\item[{Mat\+Type \&}]{output }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Function for P\+CA whitening. 


\begin{DoxyParams}{Parameters}
{\em input} & Dataset to scale features. \\
\hline
{\em output} & Output matrix with whitened features. \\
\hline
\end{DoxyParams}


Definition at line 87 of file pca\+\_\+whitening.\+hpp.



Referenced by Z\+C\+A\+Whitening\+::\+Transform().



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/core/data/scaler\+\_\+methods/\textbf{ pca\+\_\+whitening.\+hpp}\end{DoxyCompactItemize}
