\section{Max\+Abs\+Scaler Class Reference}
\label{classmlpack_1_1data_1_1MaxAbsScaler}\index{Max\+Abs\+Scaler@{Max\+Abs\+Scaler}}


A simple Max\+Abs 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\+Max} () const
\begin{DoxyCompactList}\small\item\em Get the Max row vector. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Item\+Min} () const
\begin{DoxyCompactList}\small\item\em Get the Min row vector. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Scale} () const
\begin{DoxyCompactList}\small\item\em Get the Scale 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 Max\+Abs Scaler class. 

Given an input dataset this class helps you to scale each feature by its maximum absolute value.

[z = x / max(abs(x))]

where max(abs(x)) is maximum absolute value of feature.


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

\textcolor{comment}{// Fit the features.}
MaxAbsScaler 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 46 of file max\+\_\+abs\+\_\+scaler.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1data_1_1MaxAbsScaler_a0b68c1a39a21e56e10f5b9250b056244}} 
\index{mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+Scaler}!Fit@{Fit}}
\index{Fit@{Fit}!mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+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 55 of file max\+\_\+abs\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MaxAbsScaler_afb0e67c6fbf5a527f63469bbbf07066c}} 
\index{mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+Scaler}!Inverse\+Transform@{Inverse\+Transform}}
\index{Inverse\+Transform@{Inverse\+Transform}!mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+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 max\+\_\+abs\+\_\+scaler.\+hpp.

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



Get the Max row vector. 



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

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



Get the Min row vector. 



Definition at line 97 of file max\+\_\+abs\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MaxAbsScaler_a5adcafebd2c229793e57b7268c90a0fe}} 
\index{mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+Scaler}!Scale@{Scale}}
\index{Scale@{Scale}!mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+Scaler}}
\subsubsection{Scale()}
{\footnotesize\ttfamily const arma\+::vec\& Scale (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the Scale row vector. 



Definition at line 101 of file max\+\_\+abs\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MaxAbsScaler_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+Scaler}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+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 104 of file max\+\_\+abs\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MaxAbsScaler_a7bc470a1e097f5b0aaf2396691432b3f}} 
\index{mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+Scaler}!Transform@{Transform}}
\index{Transform@{Transform}!mlpack\+::data\+::\+Max\+Abs\+Scaler@{mlpack\+::data\+::\+Max\+Abs\+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 max\+\_\+abs\+\_\+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.\+2/src/mlpack/core/data/scaler\+\_\+methods/\textbf{ max\+\_\+abs\+\_\+scaler.\+hpp}\end{DoxyCompactItemize}
