\section{Min\+Max\+Scaler Class Reference}
\label{classmlpack_1_1data_1_1MinMaxScaler}\index{Min\+Max\+Scaler@{Min\+Max\+Scaler}}


A simple Min\+Max Scaler class.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Min\+Max\+Scaler} (const double min=0, const double max=1)
\begin{DoxyCompactList}\small\item\em Default constructor. \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\+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 
double \textbf{ Scale\+Max} () const
\begin{DoxyCompactList}\small\item\em Get the upper range parameter. \end{DoxyCompactList}\item 
double \textbf{ Scale\+Min} () const
\begin{DoxyCompactList}\small\item\em Get the lower range parameter. \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 Min\+Max Scaler class. 

Given an input dataset this class helps you to scale each feature to a given range.

[z = scale $\ast$ x + scale\+Min -\/ min(x) $\ast$ scale] [scale = (scale\+Max -\/ scale\+Min) / (max(x) -\/ min(x))]

where scale\+Min, scale\+Max = feature\+\_\+range and min(x), max(x) are the minimum and maximum value of x respectively.


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

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



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_acb30d2500651f0921263773ddd493252}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Min\+Max\+Scaler@{Min\+Max\+Scaler}}
\index{Min\+Max\+Scaler@{Min\+Max\+Scaler}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}}
\subsubsection{Min\+Max\+Scaler()}
{\footnotesize\ttfamily \textbf{ Min\+Max\+Scaler} (\begin{DoxyParamCaption}\item[{const double}]{min = {\ttfamily 0},  }\item[{const double}]{max = {\ttfamily 1} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Default constructor. 


\begin{DoxyParams}{Parameters}
{\em min} & Lower range of scaling. \\
\hline
{\em max} & Upper range of scaling. \\
\hline
\end{DoxyParams}


Definition at line 57 of file min\+\_\+max\+\_\+scaler.\+hpp.



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

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_afb0e67c6fbf5a527f63469bbbf07066c}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Inverse\+Transform@{Inverse\+Transform}}
\index{Inverse\+Transform@{Inverse\+Transform}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+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 113 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_a5ed43c216f23cf96c432216d6fc2a1c3}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Item\+Max@{Item\+Max}}
\index{Item\+Max@{Item\+Max}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+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 122 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_ae9ae591f227874f238c38d4cf070c6c8}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Item\+Min@{Item\+Min}}
\index{Item\+Min@{Item\+Min}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+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 120 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_a5adcafebd2c229793e57b7268c90a0fe}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Scale@{Scale}}
\index{Scale@{Scale}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+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 124 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_a841ab6e52291099af1ea0d7f50b31f87}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Scale\+Max@{Scale\+Max}}
\index{Scale\+Max@{Scale\+Max}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}}
\subsubsection{Scale\+Max()}
{\footnotesize\ttfamily double Scale\+Max (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the upper range parameter. 



Definition at line 126 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_a478b195e13c72fe1a667f93dfbf5b613}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Scale\+Min@{Scale\+Min}}
\index{Scale\+Min@{Scale\+Min}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}}
\subsubsection{Scale\+Min()}
{\footnotesize\ttfamily double Scale\+Min (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the lower range parameter. 



Definition at line 128 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+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 131 of file min\+\_\+max\+\_\+scaler.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1MinMaxScaler_a7bc470a1e097f5b0aaf2396691432b3f}} 
\index{mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+Scaler}!Transform@{Transform}}
\index{Transform@{Transform}!mlpack\+::data\+::\+Min\+Max\+Scaler@{mlpack\+::data\+::\+Min\+Max\+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 95 of file min\+\_\+max\+\_\+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-\/git/src/mlpack/core/data/scaler\+\_\+methods/\textbf{ min\+\_\+max\+\_\+scaler.\+hpp}\end{DoxyCompactItemize}
