\section{Z\+C\+A\+Whitening Class Reference}
\label{classmlpack_1_1data_1_1ZCAWhitening}\index{Z\+C\+A\+Whitening@{Z\+C\+A\+Whitening}}


A simple \doxyref{Z\+C\+A\+Whitening}{p.}{classmlpack_1_1data_1_1ZCAWhitening} class.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Z\+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 
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 Z\+CA whitening. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A simple \doxyref{Z\+C\+A\+Whitening}{p.}{classmlpack_1_1data_1_1ZCAWhitening} 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.}
ZCAWhitening 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 zca\+\_\+whitening.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_ada219c9dd0fbf3d6e728aca8f5711fbb}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Z\+C\+A\+Whitening@{Z\+C\+A\+Whitening}}
\index{Z\+C\+A\+Whitening@{Z\+C\+A\+Whitening}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}}
\subsubsection{Z\+C\+A\+Whitening()}
{\footnotesize\ttfamily \textbf{ Z\+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 zca\+\_\+whitening.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_a5d2e9b59773a10f622f833c406435cf4}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Eigen\+Values@{Eigen\+Values}}
\index{Eigen\+Values@{Eigen\+Values}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 98 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Eigen\+Values().

\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_a6a2521e3588c5bb0ff6191c68d97b217}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Eigen\+Vectors@{Eigen\+Vectors}}
\index{Eigen\+Vectors@{Eigen\+Vectors}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 100 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Eigen\+Vectors().

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



Get the regularization parameter. 



Definition at line 102 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Epsilon().

\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_a0b68c1a39a21e56e10f5b9250b056244}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Fit@{Fit}}
\index{Fit@{Fit}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 63 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Fit().

\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_afb0e67c6fbf5a527f63469bbbf07066c}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Inverse\+Transform@{Inverse\+Transform}}
\index{Inverse\+Transform@{Inverse\+Transform}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 88 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Eigen\+Values(), P\+C\+A\+Whitening\+::\+Eigen\+Vectors(), and P\+C\+A\+Whitening\+::\+Item\+Mean().

\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_a95996a797e721bc9acc0c9a5d697fdcf}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Item\+Mean@{Item\+Mean}}
\index{Item\+Mean@{Item\+Mean}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 96 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Item\+Mean().

\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 105 of file zca\+\_\+whitening.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1ZCAWhitening_a7bc470a1e097f5b0aaf2396691432b3f}} 
\index{mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+C\+A\+Whitening}!Transform@{Transform}}
\index{Transform@{Transform}!mlpack\+::data\+::\+Z\+C\+A\+Whitening@{mlpack\+::data\+::\+Z\+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 Z\+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 75 of file zca\+\_\+whitening.\+hpp.



References P\+C\+A\+Whitening\+::\+Eigen\+Vectors(), and P\+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-\/git/src/mlpack/core/data/scaler\+\_\+methods/\textbf{ zca\+\_\+whitening.\+hpp}\end{DoxyCompactItemize}
