\section{All\+Categorical\+Split$<$ Fitness\+Function $>$ Class Template Reference}
\label{classmlpack_1_1tree_1_1AllCategoricalSplit}\index{All\+Categorical\+Split$<$ Fitness\+Function $>$@{All\+Categorical\+Split$<$ Fitness\+Function $>$}}


The \doxyref{All\+Categorical\+Split}{p.}{classmlpack_1_1tree_1_1AllCategoricalSplit} is a splitting function that will split categorical features into many children\+: one child for each category.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \textbf{ Auxiliary\+Split\+Info}
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Elem\+Type $>$ }\\static size\+\_\+t \textbf{ Calculate\+Direction} (const Elem\+Type \&point, const arma\+::\+Col$<$ Elem\+Type $>$ \&class\+Probabilities, const \textbf{ Auxiliary\+Split\+Info}$<$ Elem\+Type $>$ \&)
\begin{DoxyCompactList}\small\item\em Calculate the direction a point should percolate to. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Elem\+Type $>$ }\\static size\+\_\+t \textbf{ Num\+Children} (const arma\+::\+Col$<$ Elem\+Type $>$ \&class\+Probabilities, const \textbf{ Auxiliary\+Split\+Info}$<$ Elem\+Type $>$ \&)
\begin{DoxyCompactList}\small\item\em Return the number of children in the split. \end{DoxyCompactList}\item 
{\footnotesize template$<$bool Use\+Weights, typename Vec\+Type , typename Weight\+Vec\+Type $>$ }\\static double \textbf{ Split\+If\+Better} (const double best\+Gain, const Vec\+Type \&data, const size\+\_\+t num\+Categories, const arma\+::\+Row$<$ size\+\_\+t $>$ \&labels, const size\+\_\+t num\+Classes, const Weight\+Vec\+Type \&weights, const size\+\_\+t minimum\+Leaf\+Size, const double minimum\+Gain\+Split, arma\+::\+Col$<$ typename Vec\+Type\+::elem\+\_\+type $>$ \&class\+Probabilities, \textbf{ Auxiliary\+Split\+Info}$<$ typename Vec\+Type\+::elem\+\_\+type $>$ \&aux)
\begin{DoxyCompactList}\small\item\em Check if we can split a node. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Fitness\+Function$>$\newline
class mlpack\+::tree\+::\+All\+Categorical\+Split$<$ Fitness\+Function $>$}

The \doxyref{All\+Categorical\+Split}{p.}{classmlpack_1_1tree_1_1AllCategoricalSplit} is a splitting function that will split categorical features into many children\+: one child for each category. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Fitness\+Function} & Fitness function to evaluate gain with. \\
\hline
\end{DoxyTemplParams}


Definition at line 28 of file all\+\_\+categorical\+\_\+split.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1tree_1_1AllCategoricalSplit_adee8fec546042a57582d7aeab7425690}} 
\index{mlpack\+::tree\+::\+All\+Categorical\+Split@{mlpack\+::tree\+::\+All\+Categorical\+Split}!Calculate\+Direction@{Calculate\+Direction}}
\index{Calculate\+Direction@{Calculate\+Direction}!mlpack\+::tree\+::\+All\+Categorical\+Split@{mlpack\+::tree\+::\+All\+Categorical\+Split}}
\subsubsection{Calculate\+Direction()}
{\footnotesize\ttfamily static size\+\_\+t Calculate\+Direction (\begin{DoxyParamCaption}\item[{const Elem\+Type \&}]{point,  }\item[{const arma\+::\+Col$<$ Elem\+Type $>$ \&}]{class\+Probabilities,  }\item[{const \textbf{ Auxiliary\+Split\+Info}$<$ Elem\+Type $>$ \&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Calculate the direction a point should percolate to. 


\begin{DoxyParams}{Parameters}
{\em point} & the Point to use. \\
\hline
{\em class\+Probabilities} & Column Vector of class probabilities. \\
\hline
{\em $\ast$} & (aux) Auxiliary information for the split (Unused). \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1tree_1_1AllCategoricalSplit_adf571c6a85c385ffe99fe5a0b8322ef1}} 
\index{mlpack\+::tree\+::\+All\+Categorical\+Split@{mlpack\+::tree\+::\+All\+Categorical\+Split}!Num\+Children@{Num\+Children}}
\index{Num\+Children@{Num\+Children}!mlpack\+::tree\+::\+All\+Categorical\+Split@{mlpack\+::tree\+::\+All\+Categorical\+Split}}
\subsubsection{Num\+Children()}
{\footnotesize\ttfamily static size\+\_\+t Num\+Children (\begin{DoxyParamCaption}\item[{const arma\+::\+Col$<$ Elem\+Type $>$ \&}]{class\+Probabilities,  }\item[{const \textbf{ Auxiliary\+Split\+Info}$<$ Elem\+Type $>$ \&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Return the number of children in the split. 


\begin{DoxyParams}{Parameters}
{\em class\+Probabilities} & Auxiliary information for the split. \\
\hline
{\em $\ast$} & (aux) Auxiliary information for the split (Unused). \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1tree_1_1AllCategoricalSplit_ac03bd24ded8520b5e39a7023d3fb0ff0}} 
\index{mlpack\+::tree\+::\+All\+Categorical\+Split@{mlpack\+::tree\+::\+All\+Categorical\+Split}!Split\+If\+Better@{Split\+If\+Better}}
\index{Split\+If\+Better@{Split\+If\+Better}!mlpack\+::tree\+::\+All\+Categorical\+Split@{mlpack\+::tree\+::\+All\+Categorical\+Split}}
\subsubsection{Split\+If\+Better()}
{\footnotesize\ttfamily static double Split\+If\+Better (\begin{DoxyParamCaption}\item[{const double}]{best\+Gain,  }\item[{const Vec\+Type \&}]{data,  }\item[{const size\+\_\+t}]{num\+Categories,  }\item[{const arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{labels,  }\item[{const size\+\_\+t}]{num\+Classes,  }\item[{const Weight\+Vec\+Type \&}]{weights,  }\item[{const size\+\_\+t}]{minimum\+Leaf\+Size,  }\item[{const double}]{minimum\+Gain\+Split,  }\item[{arma\+::\+Col$<$ typename Vec\+Type\+::elem\+\_\+type $>$ \&}]{class\+Probabilities,  }\item[{\textbf{ Auxiliary\+Split\+Info}$<$ typename Vec\+Type\+::elem\+\_\+type $>$ \&}]{aux }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Check if we can split a node. 

If we can split a node in a way that improves on \textquotesingle{}best\+Gain\textquotesingle{}, then we return the improved gain. Otherwise we return the value \textquotesingle{}best\+Gain\textquotesingle{}. If a split is made, then class\+Probabilities and aux may be modified. For this particular split type, aux will be empty and class\+Probabilities will hold one element---the number of children.


\begin{DoxyParams}{Parameters}
{\em best\+Gain} & Best gain seen so far (we\textquotesingle{}ll only split if we find gain better than this). \\
\hline
{\em data} & The dimension of data points to check for a split in. \\
\hline
{\em num\+Categories} & Number of categories in the categorical data. \\
\hline
{\em labels} & Labels for each point. \\
\hline
{\em num\+Classes} & Number of classes in the dataset. \\
\hline
{\em weights} & Weights associated with labels. \\
\hline
{\em minimum\+Leaf\+Size} & Minimum number of points in a leaf node for splitting. \\
\hline
{\em class\+Probabilities} & Class probabilities vector, which may be filled with split information a successful split. \\
\hline
{\em minimum\+Gain\+Split} & Minimum gain split. \\
\hline
{\em aux} & Auxiliary split information, which may be modified on a successful split. \\
\hline
\end{DoxyParams}


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/methods/decision\+\_\+tree/\textbf{ all\+\_\+categorical\+\_\+split.\+hpp}\end{DoxyCompactItemize}
