\section{Standard\+Scaler Class Reference}
\label{classmlpack_1_1data_1_1StandardScaler}\index{Standard\+Scaler@{Standard\+Scaler}}


A simple Standard Scaler class.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\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 
const arma\+::vec \& \textbf{ Item\+Std\+Dev} () const
\begin{DoxyCompactList}\small\item\em Get the standard deviation 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 to scale features. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A simple Standard Scaler class. 

Given an input dataset this class helps you to Standardize features by removing the mean and scaling to unit variance.

[z = (x -\/ u) / s]

where u is the mean of the training samples and s is the standard deviation of the training samples.


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

\textcolor{comment}{// Fit the features.}
StandardScaler 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 standard\+\_\+scaler.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1data_1_1StandardScaler_a0b68c1a39a21e56e10f5b9250b056244}} 
\index{mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}!Fit@{Fit}}
\index{Fit@{Fit}!mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}}
\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 56 of file standard\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1StandardScaler_afb0e67c6fbf5a527f63469bbbf07066c}} 
\index{mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}!Inverse\+Transform@{Inverse\+Transform}}
\index{Inverse\+Transform@{Inverse\+Transform}!mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}}
\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 90 of file standard\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1StandardScaler_a95996a797e721bc9acc0c9a5d697fdcf}} 
\index{mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}!Item\+Mean@{Item\+Mean}}
\index{Item\+Mean@{Item\+Mean}!mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}}
\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 97 of file standard\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1StandardScaler_ae87a954fbaec076dbe0ca5c0f286ba09}} 
\index{mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}!Item\+Std\+Dev@{Item\+Std\+Dev}}
\index{Item\+Std\+Dev@{Item\+Std\+Dev}!mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}}
\subsubsection{Item\+Std\+Dev()}
{\footnotesize\ttfamily const arma\+::vec\& Item\+Std\+Dev (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the standard deviation row vector. 



Definition at line 99 of file standard\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1StandardScaler_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}}
\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 102 of file standard\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1StandardScaler_a7bc470a1e097f5b0aaf2396691432b3f}} 
\index{mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}!Transform@{Transform}}
\index{Transform@{Transform}!mlpack\+::data\+::\+Standard\+Scaler@{mlpack\+::data\+::\+Standard\+Scaler}}
\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 to scale features. 


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


Definition at line 72 of file standard\+\_\+scaler.\+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.\+0/src/mlpack/core/data/scaler\+\_\+methods/\textbf{ standard\+\_\+scaler.\+hpp}\end{DoxyCompactItemize}
