\section{Increment\+Policy Class Reference}
\label{classmlpack_1_1data_1_1IncrementPolicy}\index{Increment\+Policy@{Increment\+Policy}}


\doxyref{Increment\+Policy}{p.}{classmlpack_1_1data_1_1IncrementPolicy} is used as a helper class for \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper}.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
using \textbf{ Mapped\+Type} = size\+\_\+t
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Increment\+Policy} (const bool force\+All\+Mappings=false)
\item 
{\footnotesize template$<$typename T , typename Input\+Type $>$ }\\void \textbf{ Map\+First\+Pass} (const Input\+Type \&input, const size\+\_\+t dim, std\+::vector$<$ \textbf{ Datatype} $>$ \&types)
\begin{DoxyCompactList}\small\item\em Determine if the dimension is numeric or categorical. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Map\+Type , typename T , typename Input\+Type $>$ }\\T \textbf{ Map\+String} (const Input\+Type \&input, const size\+\_\+t dimension, Map\+Type \&maps, std\+::vector$<$ \textbf{ Datatype} $>$ \&types)
\begin{DoxyCompactList}\small\item\em Given the input and the dimension to which the it belongs, and the maps and types given by the \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} class, returns its numeric mapping. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static const bool \textbf{ Needs\+First\+Pass} = true
\begin{DoxyCompactList}\small\item\em We do need a first pass over the data to set the dimension types right. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\doxyref{Increment\+Policy}{p.}{classmlpack_1_1data_1_1IncrementPolicy} is used as a helper class for \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper}. 

It tells how the strings should be mapped. Purpose of this policy is to map all dimension if one of the variables in a dimension turns out to be a categorical variable. \doxyref{Increment\+Policy}{p.}{classmlpack_1_1data_1_1IncrementPolicy} maps strings to incrementing unsigned integers (size\+\_\+t). The first input to be mapped will be mapped to 0, the next to 1 and so on.

If the \textquotesingle{}force\+All\+Mappings\textquotesingle{} parameter is set to true, this will always map. Otherwise, inputs will only be mapped if they cannot be cast to the output type via a stringstream extraction. 

Definition at line 33 of file increment\+\_\+policy.\+hpp.



\subsection{Member Typedef Documentation}
\mbox{\label{classmlpack_1_1data_1_1IncrementPolicy_af69dde245ce7bff33371d70e40886cdb}} 
\index{mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}!Mapped\+Type@{Mapped\+Type}}
\index{Mapped\+Type@{Mapped\+Type}!mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}}
\subsubsection{Mapped\+Type}
{\footnotesize\ttfamily using \textbf{ Mapped\+Type} =  size\+\_\+t}



Definition at line 40 of file increment\+\_\+policy.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1data_1_1IncrementPolicy_a2dd7eacb1bec6fc7c6e71e7e9bc159e0}} 
\index{mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}!Increment\+Policy@{Increment\+Policy}}
\index{Increment\+Policy@{Increment\+Policy}!mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}}
\subsubsection{Increment\+Policy()}
{\footnotesize\ttfamily \textbf{ Increment\+Policy} (\begin{DoxyParamCaption}\item[{const bool}]{force\+All\+Mappings = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 36 of file increment\+\_\+policy.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1data_1_1IncrementPolicy_abee97eb223d917dcd8f4da68e59cee46}} 
\index{mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}!Map\+First\+Pass@{Map\+First\+Pass}}
\index{Map\+First\+Pass@{Map\+First\+Pass}!mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}}
\subsubsection{Map\+First\+Pass()}
{\footnotesize\ttfamily void Map\+First\+Pass (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{const size\+\_\+t}]{dim,  }\item[{std\+::vector$<$ \textbf{ Datatype} $>$ \&}]{types }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Determine if the dimension is numeric or categorical. 



Definition at line 49 of file increment\+\_\+policy.\+hpp.



References mlpack\+::data\+::categorical.

\mbox{\label{classmlpack_1_1data_1_1IncrementPolicy_ab39961e90a7e1a33d0f1ab3d4004b807}} 
\index{mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}!Map\+String@{Map\+String}}
\index{Map\+String@{Map\+String}!mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}}
\subsubsection{Map\+String()}
{\footnotesize\ttfamily T Map\+String (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{const size\+\_\+t}]{dimension,  }\item[{Map\+Type \&}]{maps,  }\item[{std\+::vector$<$ \textbf{ Datatype} $>$ \&}]{types }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Given the input and the dimension to which the it belongs, and the maps and types given by the \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} class, returns its numeric mapping. 

If no mapping yet exists, the input is added to the list of mappings for the given dimension. This function is used as a helper function for \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} class.


\begin{DoxyTemplParams}{Template Parameters}
{\em Map\+Type} & Type of unordered\+\_\+map that contains mapped value pairs \\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em input} & Input to find/create mapping for. \\
\hline
{\em dimension} & Index of the dimension of the input. \\
\hline
{\em maps} & Unordered map given by the \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper}. \\
\hline
{\em types} & Vector containing the type information about each dimensions. \\
\hline
\end{DoxyParams}


Definition at line 90 of file increment\+\_\+policy.\+hpp.



References mlpack\+::data\+::categorical, and mlpack\+::data\+::numeric.



\subsection{Member Data Documentation}
\mbox{\label{classmlpack_1_1data_1_1IncrementPolicy_a6ef7d83a1da0e9f1d02b61f62e852079}} 
\index{mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}!Needs\+First\+Pass@{Needs\+First\+Pass}}
\index{Needs\+First\+Pass@{Needs\+First\+Pass}!mlpack\+::data\+::\+Increment\+Policy@{mlpack\+::data\+::\+Increment\+Policy}}
\subsubsection{Needs\+First\+Pass}
{\footnotesize\ttfamily const bool Needs\+First\+Pass = true\hspace{0.3cm}{\ttfamily [static]}}



We do need a first pass over the data to set the dimension types right. 



Definition at line 43 of file increment\+\_\+policy.\+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/map\+\_\+policies/\textbf{ increment\+\_\+policy.\+hpp}\end{DoxyCompactItemize}
