\section{Best\+Binary\+Numeric\+Split$<$ Fitness\+Function $>$ Class Template Reference}
\label{classmlpack_1_1tree_1_1BestBinaryNumericSplit}\index{Best\+Binary\+Numeric\+Split$<$ Fitness\+Function $>$@{Best\+Binary\+Numeric\+Split$<$ Fitness\+Function $>$}}


The \doxyref{Best\+Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BestBinaryNumericSplit} is a splitting function for decision trees that will exhaustively search a numeric dimension for the best binary split.  


\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 Given a point, calculate which child it should go to (left or right). \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Elem\+Type $>$ }\\static size\+\_\+t \textbf{ Num\+Children} (const arma\+::\+Col$<$ Elem\+Type $>$ \&, const \textbf{ Auxiliary\+Split\+Info}$<$ Elem\+Type $>$ \&)
\begin{DoxyCompactList}\small\item\em Returns 2, since the binary split always has two children. \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 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\+::\+Best\+Binary\+Numeric\+Split$<$ Fitness\+Function $>$}

The \doxyref{Best\+Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BestBinaryNumericSplit} is a splitting function for decision trees that will exhaustively search a numeric dimension for the best binary split. 


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


Definition at line 27 of file best\+\_\+binary\+\_\+numeric\+\_\+split.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1tree_1_1BestBinaryNumericSplit_adee8fec546042a57582d7aeab7425690}} 
\index{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split}!Calculate\+Direction@{Calculate\+Direction}}
\index{Calculate\+Direction@{Calculate\+Direction}!mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+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]}}



Given a point, calculate which child it should go to (left or right). 


\begin{DoxyParams}{Parameters}
{\em point} & Point to calculate direction of. \\
\hline
{\em class\+Probabilities} & Auxiliary information for the split. \\
\hline
{\em $\ast$} & (aux) Auxiliary information for the split (Unused). \\
\hline
\end{DoxyParams}


Referenced by Best\+Binary\+Numeric\+Split$<$ Fitness\+Function $>$\+::\+Num\+Children().

\mbox{\label{classmlpack_1_1tree_1_1BestBinaryNumericSplit_a401081459fbdf56967c65d0e367f4958}} 
\index{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split}!Num\+Children@{Num\+Children}}
\index{Num\+Children@{Num\+Children}!mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split}}
\subsubsection{Num\+Children()}
{\footnotesize\ttfamily static size\+\_\+t Num\+Children (\begin{DoxyParamCaption}\item[{const arma\+::\+Col$<$ Elem\+Type $>$ \&}]{,  }\item[{const \textbf{ Auxiliary\+Split\+Info}$<$ Elem\+Type $>$ \&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns 2, since the binary split always has two children. 



Definition at line 70 of file best\+\_\+binary\+\_\+numeric\+\_\+split.\+hpp.



References Best\+Binary\+Numeric\+Split$<$ Fitness\+Function $>$\+::\+Calculate\+Direction().

\mbox{\label{classmlpack_1_1tree_1_1BestBinaryNumericSplit_a79d0e5441034f325890be4e30f0da5d0}} 
\index{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split}!Split\+If\+Better@{Split\+If\+Better}}
\index{Split\+If\+Better@{Split\+If\+Better}!mlpack\+::tree\+::\+Best\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Best\+Binary\+Numeric\+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 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.


\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 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 minimum\+Gain\+Split} & Minimum gain split. \\
\hline
{\em class\+Probabilities} & Class probabilities vector, which may be filled with split information a successful 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{ best\+\_\+binary\+\_\+numeric\+\_\+split.\+hpp}\end{DoxyCompactItemize}
