\section{Decision\+Stump$<$ Mat\+Type $>$ Class Template Reference}
\label{classmlpack_1_1decision__stump_1_1DecisionStump}\index{Decision\+Stump$<$ Mat\+Type $>$@{Decision\+Stump$<$ Mat\+Type $>$}}


This class implements a decision stump.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ mlpack\+\_\+deprecated} \textbf{ Decision\+Stump} (const Mat\+Type \&data, const arma\+::\+Row$<$ size\+\_\+t $>$ \&labels, const size\+\_\+t num\+Classes, const size\+\_\+t bucket\+Size=10)
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
\textbf{ mlpack\+\_\+deprecated} \textbf{ Decision\+Stump} (const \textbf{ Decision\+Stump}$<$$>$ \&other, const Mat\+Type \&data, const arma\+::\+Row$<$ size\+\_\+t $>$ \&labels, const size\+\_\+t num\+Classes, const arma\+::rowvec \&weights)
\begin{DoxyCompactList}\small\item\em Alternate constructor which copies the parameters bucket\+Size and classes from an already initiated decision stump, other. \end{DoxyCompactList}\item 
\textbf{ Decision\+Stump} ()
\begin{DoxyCompactList}\small\item\em Create a decision stump without training. \end{DoxyCompactList}\item 
const arma\+::\+Col$<$ size\+\_\+t $>$ \textbf{ Bin\+Labels} () const
\begin{DoxyCompactList}\small\item\em Access the labels for each split bin. \end{DoxyCompactList}\item 
arma\+::\+Col$<$ size\+\_\+t $>$ \& \textbf{ Bin\+Labels} ()
\begin{DoxyCompactList}\small\item\em Modify the labels for each split bin (be careful!). \end{DoxyCompactList}\item 
\textbf{ mlpack\+\_\+deprecated} void \textbf{ Classify} (const Mat\+Type \&test, arma\+::\+Row$<$ size\+\_\+t $>$ \&predicted\+Labels)
\begin{DoxyCompactList}\small\item\em Classification function. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the decision stump. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Split} () const
\begin{DoxyCompactList}\small\item\em Access the splitting values. \end{DoxyCompactList}\item 
arma\+::vec \& \textbf{ Split} ()
\begin{DoxyCompactList}\small\item\em Modify the splitting values (be careful!). \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Split\+Dimension} () const
\begin{DoxyCompactList}\small\item\em Access the splitting dimension. \end{DoxyCompactList}\item 
size\+\_\+t \& \textbf{ Split\+Dimension} ()
\begin{DoxyCompactList}\small\item\em Modify the splitting dimension (be careful!). \end{DoxyCompactList}\item 
\textbf{ mlpack\+\_\+deprecated} double \textbf{ Train} (const Mat\+Type \&data, const arma\+::\+Row$<$ size\+\_\+t $>$ \&labels, const size\+\_\+t num\+Classes, const size\+\_\+t bucket\+Size)
\begin{DoxyCompactList}\small\item\em Train the decision stump on the given data. \end{DoxyCompactList}\item 
\textbf{ mlpack\+\_\+deprecated} double \textbf{ Train} (const Mat\+Type \&data, const arma\+::\+Row$<$ size\+\_\+t $>$ \&labels, const arma\+::rowvec \&weights, const size\+\_\+t num\+Classes, const size\+\_\+t bucket\+Size)
\begin{DoxyCompactList}\small\item\em Train the decision stump on the given data, with the given weights. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Mat\+Type = arma\+::mat$>$\newline
class mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump$<$ Mat\+Type $>$}

This class implements a decision stump. 

It constructs a single level decision tree, i.\+e., a decision stump. It uses entropy to decide splitting ranges.

The stump is parameterized by a splitting dimension (the dimension on which points are split), a vector of bin split values, and a vector of labels for each bin. Bin i is specified by the range [split[i], split[i + 1]). The last bin has range up to  (split[i + 1] does not exist in that case). Points that are below the first bin will take the label of the first bin.

\begin{DoxyNote}{Note}
This class has been deprecated and should be removed in mlpack 4.\+0.\+0. Use {\ttfamily I\+D3\+Decision\+Stump}, found in src/mlpack/methods/decision\+\_\+tree/, instead.
\end{DoxyNote}

\begin{DoxyTemplParams}{Template Parameters}
{\em Mat\+Type} & Type of matrix that is being used (sparse or dense). \\
\hline
\end{DoxyTemplParams}


Definition at line 38 of file decision\+\_\+stump.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a0097442a58178fe02dc3bc350e81c575}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Decision\+Stump@{Decision\+Stump}}
\index{Decision\+Stump@{Decision\+Stump}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Decision\+Stump()\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} \textbf{ Decision\+Stump} (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{const arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{labels,  }\item[{const size\+\_\+t}]{num\+Classes,  }\item[{const size\+\_\+t}]{bucket\+Size = {\ttfamily 10} }\end{DoxyParamCaption})}



Constructor. 

Train on the provided data. Generate a decision stump from data.


\begin{DoxyParams}{Parameters}
{\em data} & Input, training data. \\
\hline
{\em labels} & Labels of training data. \\
\hline
{\em num\+Classes} & Number of distinct classes in labels. \\
\hline
{\em bucket\+Size} & Minimum size of bucket when splitting. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a1f9f29afe6e27ca8017fb909c30daccc}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Decision\+Stump@{Decision\+Stump}}
\index{Decision\+Stump@{Decision\+Stump}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Decision\+Stump()\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} \textbf{ Decision\+Stump} (\begin{DoxyParamCaption}\item[{const \textbf{ Decision\+Stump}$<$$>$ \&}]{other,  }\item[{const Mat\+Type \&}]{data,  }\item[{const arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{labels,  }\item[{const size\+\_\+t}]{num\+Classes,  }\item[{const arma\+::rowvec \&}]{weights }\end{DoxyParamCaption})}



Alternate constructor which copies the parameters bucket\+Size and classes from an already initiated decision stump, other. 

It appropriately sets the weight vector.


\begin{DoxyParams}{Parameters}
{\em other} & The other initiated Decision Stump object from which we copy the values. \\
\hline
{\em data} & The data on which to train this object on. \\
\hline
{\em labels} & The labels of data. \\
\hline
{\em weights} & Weight vector to use while training. For boosting purposes. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_aef419bc9b90c234d0d1b320aeb8abb7e}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Decision\+Stump@{Decision\+Stump}}
\index{Decision\+Stump@{Decision\+Stump}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Decision\+Stump()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \textbf{ Decision\+Stump} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Create a decision stump without training. 

This stump will not be useful and will always return a class of 0 for anything that is to be classified, so it would be a prudent idea to call \doxyref{Train()}{p.}{classmlpack_1_1decision__stump_1_1DecisionStump_a175d3d52b147fa44e459577dbfe9e8bd} after using this constructor. 

\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_acef1f1f9ad303a0c55df2fb080a10087}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Bin\+Labels@{Bin\+Labels}}
\index{Bin\+Labels@{Bin\+Labels}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Bin\+Labels()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const arma\+::\+Col$<$size\+\_\+t$>$ Bin\+Labels (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Access the labels for each split bin. 



Definition at line 135 of file decision\+\_\+stump.\+hpp.

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_af8495e4e689b96ee5a5609853aff351f}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Bin\+Labels@{Bin\+Labels}}
\index{Bin\+Labels@{Bin\+Labels}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Bin\+Labels()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily arma\+::\+Col$<$size\+\_\+t$>$\& Bin\+Labels (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the labels for each split bin (be careful!). 



Definition at line 137 of file decision\+\_\+stump.\+hpp.



References Decision\+Stump$<$ Mat\+Type $>$\+::serialize(), and Decision\+Stump$<$ Mat\+Type $>$\+::\+Train().

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a362dbc763f7a9f20fe12ca5db8d29b78}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Classify@{Classify}}
\index{Classify@{Classify}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Classify()}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} void Classify (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{test,  }\item[{arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{predicted\+Labels }\end{DoxyParamCaption})}



Classification function. 

After training, classify test, and put the predicted classes in predicted\+Labels.


\begin{DoxyParams}{Parameters}
{\em test} & Testing data or data to classify. \\
\hline
{\em predicted\+Labels} & Vector to store the predicted classes after classifying test data. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the decision stump. 



Referenced by Decision\+Stump$<$ Mat\+Type $>$\+::\+Bin\+Labels().

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a563fe71adede33d66778b29f5cdd31b3}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Split@{Split}}
\index{Split@{Split}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Split()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const arma\+::vec\& Split (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Access the splitting values. 



Definition at line 130 of file decision\+\_\+stump.\+hpp.

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a223d525221c5f3053a005091dbc6e690}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Split@{Split}}
\index{Split@{Split}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Split()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily arma\+::vec\& Split (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the splitting values (be careful!). 



Definition at line 132 of file decision\+\_\+stump.\+hpp.

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a92f55f07c1a09552ef79c8d8b9484af5}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Split\+Dimension@{Split\+Dimension}}
\index{Split\+Dimension@{Split\+Dimension}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Split\+Dimension()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily size\+\_\+t Split\+Dimension (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Access the splitting dimension. 



Definition at line 125 of file decision\+\_\+stump.\+hpp.

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_afa731824b1b820b9f276663970469d58}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Split\+Dimension@{Split\+Dimension}}
\index{Split\+Dimension@{Split\+Dimension}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Split\+Dimension()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily size\+\_\+t\& Split\+Dimension (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the splitting dimension (be careful!). 



Definition at line 127 of file decision\+\_\+stump.\+hpp.

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_a175d3d52b147fa44e459577dbfe9e8bd}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Train@{Train}}
\index{Train@{Train}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} double Train (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{const arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{labels,  }\item[{const size\+\_\+t}]{num\+Classes,  }\item[{const size\+\_\+t}]{bucket\+Size }\end{DoxyParamCaption})}



Train the decision stump on the given data. 

This completely overwrites any previous training data, so after training the stump may be completely different.


\begin{DoxyParams}{Parameters}
{\em data} & Dataset to train on. \\
\hline
{\em labels} & Labels for each point in the dataset. \\
\hline
{\em num\+Classes} & Number of classes in the dataset. \\
\hline
{\em bucket\+Size} & Minimum size of bucket when splitting. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The final entropy after splitting. 
\end{DoxyReturn}


Referenced by Decision\+Stump$<$ Mat\+Type $>$\+::\+Bin\+Labels().

\mbox{\label{classmlpack_1_1decision__stump_1_1DecisionStump_abc0fc207908386dc13dbce30a5414683}} 
\index{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}!Train@{Train}}
\index{Train@{Train}!mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump@{mlpack\+::decision\+\_\+stump\+::\+Decision\+Stump}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} double Train (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{const arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{labels,  }\item[{const arma\+::rowvec \&}]{weights,  }\item[{const size\+\_\+t}]{num\+Classes,  }\item[{const size\+\_\+t}]{bucket\+Size }\end{DoxyParamCaption})}



Train the decision stump on the given data, with the given weights. 

This completely overwrites any previous training data, so after training the stump may be completely different.


\begin{DoxyParams}{Parameters}
{\em data} & Dataset to train on. \\
\hline
{\em labels} & Labels for each point in the dataset. \\
\hline
{\em weights} & Weights for each point in the dataset. \\
\hline
{\em num\+Classes} & Number of classes in the dataset. \\
\hline
{\em bucket\+Size} & Minimum size of bucket when splitting. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The final entropy after splitting. 
\end{DoxyReturn}


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