\section{Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$ Class Template Reference}
\label{classmlpack_1_1tree_1_1BinaryNumericSplit}\index{Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$@{Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$}}


The \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit} class implements the numeric feature splitting strategy devised by Gama, Rocha, and Medas in the following paper\+:  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef \textbf{ Binary\+Numeric\+Split\+Info}$<$ Observation\+Type $>$ \textbf{ Split\+Info}
\begin{DoxyCompactList}\small\item\em The splitting information required by the \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Binary\+Numeric\+Split} (const size\+\_\+t num\+Classes=0)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit} object with the given number of classes. \end{DoxyCompactList}\item 
\textbf{ Binary\+Numeric\+Split} (const size\+\_\+t num\+Classes, const \textbf{ Binary\+Numeric\+Split} \&other)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit} object with the given number of classes, using information from the given other split for other parameters. \end{DoxyCompactList}\item 
void \textbf{ Evaluate\+Fitness\+Function} (double \&best\+Fitness, double \&second\+Best\+Fitness)
\begin{DoxyCompactList}\small\item\em Given the points seen so far, evaluate the fitness function, returning the best possible gain of a binary split. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Majority\+Class} () const
\begin{DoxyCompactList}\small\item\em The majority class of the points seen so far. \end{DoxyCompactList}\item 
double \textbf{ Majority\+Probability} () const
\begin{DoxyCompactList}\small\item\em The probability of the majority class given the points seen so far. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Num\+Children} () const
\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the object. \end{DoxyCompactList}\item 
void \textbf{ Split} (arma\+::\+Col$<$ size\+\_\+t $>$ \&child\+Majorities, \textbf{ Split\+Info} \&split\+Info)
\begin{DoxyCompactList}\small\item\em Given that a split should happen, return the majority classes of the (two) children and an initialized Split\+Info object. \end{DoxyCompactList}\item 
void \textbf{ Train} (Observation\+Type value, const size\+\_\+t label)
\begin{DoxyCompactList}\small\item\em Train on the given value with the given label. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Fitness\+Function, typename Observation\+Type = double$>$\newline
class mlpack\+::tree\+::\+Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$}

The \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit} class implements the numeric feature splitting strategy devised by Gama, Rocha, and Medas in the following paper\+: 


\begin{DoxyCode}
@inproceedings\{gama2003accurate,
   title=\{Accurate Decision Trees \textcolor{keywordflow}{for} Mining High-Speed Data Streams\},
   author=\{Gama, J. and Rocha, R. and Medas, P.\},
   year=\{2003\},
   booktitle=\{Proceedings of the Ninth ACM SIGKDD International Conference on
       Knowledge Discovery and Data Mining (KDD \textcolor{stringliteral}{'03)\},}
\textcolor{stringliteral}{   pages=\{523--528\}}
\textcolor{stringliteral}{\}}
\end{DoxyCode}


This splitting procedure builds a binary tree on points it has seen so far, and then \doxyref{Evaluate\+Fitness\+Function()}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit_afe419c8ff831af9ea91047e3de487609} returns the best possible split in O(n) time, where n is the number of samples seen so far. Every split with this split type returns only two splits (greater than or equal to the split point, and less than the split point). The \doxyref{Train()}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit_a4c204ab8547c9493c8c3cca15131e9c5} function should take O(1) time.


\begin{DoxyTemplParams}{Template Parameters}
{\em Fitness\+Function} & Fitness function to use for calculating gain. \\
\hline
{\em Observation\+Type} & Type of observation used by this dimension. \\
\hline
\end{DoxyTemplParams}


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



\subsection{Member Typedef Documentation}
\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_aef8eaa3db891d05ca25d008e036b316f}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Split\+Info@{Split\+Info}}
\index{Split\+Info@{Split\+Info}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Split\+Info}
{\footnotesize\ttfamily typedef \textbf{ Binary\+Numeric\+Split\+Info}$<$Observation\+Type$>$ \textbf{ Split\+Info}}



The splitting information required by the \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit}. 



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



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_a29e8da5da497548c3aea17d8ec3b48f9}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Binary\+Numeric\+Split@{Binary\+Numeric\+Split}}
\index{Binary\+Numeric\+Split@{Binary\+Numeric\+Split}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Binary\+Numeric\+Split()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \textbf{ Binary\+Numeric\+Split} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{num\+Classes = {\ttfamily 0} }\end{DoxyParamCaption})}



Create the \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit} object with the given number of classes. 


\begin{DoxyParams}{Parameters}
{\em num\+Classes} & Number of classes in dataset. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_ab1c109310ed5928ebc08b4e121ddda30}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Binary\+Numeric\+Split@{Binary\+Numeric\+Split}}
\index{Binary\+Numeric\+Split@{Binary\+Numeric\+Split}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Binary\+Numeric\+Split()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \textbf{ Binary\+Numeric\+Split} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{num\+Classes,  }\item[{const \textbf{ Binary\+Numeric\+Split}$<$ Fitness\+Function, Observation\+Type $>$ \&}]{other }\end{DoxyParamCaption})}



Create the \doxyref{Binary\+Numeric\+Split}{p.}{classmlpack_1_1tree_1_1BinaryNumericSplit} object with the given number of classes, using information from the given other split for other parameters. 

In this case, there are no other parameters, but this function is required by the \doxyref{Hoeffding\+Tree}{p.}{classmlpack_1_1tree_1_1HoeffdingTree} class. 

\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_afe419c8ff831af9ea91047e3de487609}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Evaluate\+Fitness\+Function@{Evaluate\+Fitness\+Function}}
\index{Evaluate\+Fitness\+Function@{Evaluate\+Fitness\+Function}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Evaluate\+Fitness\+Function()}
{\footnotesize\ttfamily void Evaluate\+Fitness\+Function (\begin{DoxyParamCaption}\item[{double \&}]{best\+Fitness,  }\item[{double \&}]{second\+Best\+Fitness }\end{DoxyParamCaption})}



Given the points seen so far, evaluate the fitness function, returning the best possible gain of a binary split. 

Note that this takes O(n) time, where n is the number of points seen so far. So this may not exactly be fast...

The best possible split will be stored in best\+Fitness, and the second best possible split will be stored in second\+Best\+Fitness.


\begin{DoxyParams}{Parameters}
{\em best\+Fitness} & Fitness function value for best possible split. \\
\hline
{\em second\+Best\+Fitness} & Fitness function value for second best possible split. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_a2fbf818eb68075c92655a22904b7ee1a}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Majority\+Class@{Majority\+Class}}
\index{Majority\+Class@{Majority\+Class}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Majority\+Class()}
{\footnotesize\ttfamily size\+\_\+t Majority\+Class (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



The majority class of the points seen so far. 



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

\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_a68e5f5a4d8c6194482a83440619be83b}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Majority\+Probability@{Majority\+Probability}}
\index{Majority\+Probability@{Majority\+Probability}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Majority\+Probability()}
{\footnotesize\ttfamily double Majority\+Probability (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



The probability of the majority class given the points seen so far. 



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

\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_a1f7ec083be66d58a3e02e12956bf005e}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Num\+Children@{Num\+Children}}
\index{Num\+Children@{Num\+Children}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Num\+Children()}
{\footnotesize\ttfamily size\+\_\+t Num\+Children (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



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



References Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$\+::\+Majority\+Class(), Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$\+::\+Majority\+Probability(), Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$\+::serialize(), and Binary\+Numeric\+Split$<$ Fitness\+Function, Observation\+Type $>$\+::\+Split().

\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the object. 



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

\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_a12faa9838c740b8383130fee17c108b6}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Split@{Split}}
\index{Split@{Split}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Split()}
{\footnotesize\ttfamily void Split (\begin{DoxyParamCaption}\item[{arma\+::\+Col$<$ size\+\_\+t $>$ \&}]{child\+Majorities,  }\item[{\textbf{ Split\+Info} \&}]{split\+Info }\end{DoxyParamCaption})}



Given that a split should happen, return the majority classes of the (two) children and an initialized Split\+Info object. 


\begin{DoxyParams}{Parameters}
{\em child\+Majorities} & Majority classes of the children after the split. \\
\hline
{\em split\+Info} & Split information. \\
\hline
\end{DoxyParams}


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

\mbox{\label{classmlpack_1_1tree_1_1BinaryNumericSplit_a4c204ab8547c9493c8c3cca15131e9c5}} 
\index{mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}!Train@{Train}}
\index{Train@{Train}!mlpack\+::tree\+::\+Binary\+Numeric\+Split@{mlpack\+::tree\+::\+Binary\+Numeric\+Split}}
\subsubsection{Train()}
{\footnotesize\ttfamily void Train (\begin{DoxyParamCaption}\item[{Observation\+Type}]{value,  }\item[{const size\+\_\+t}]{label }\end{DoxyParamCaption})}



Train on the given value with the given label. 


\begin{DoxyParams}{Parameters}
{\em value} & The value to train on. \\
\hline
{\em label} & The label to train on. \\
\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/hoeffding\+\_\+trees/\textbf{ binary\+\_\+numeric\+\_\+split.\+hpp}\end{DoxyCompactItemize}
