Files
mlpack/doc/html/classmlpack_1_1tree_1_1DecisionTree.html
T

1194 lines
74 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>mlpack: mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra-stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">mlpack
&#160;<span id="projectnumber">master</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacemlpack.html">mlpack</a></li><li class="navelem"><a class="el" href="namespacemlpack_1_1tree.html">tree</a></li><li class="navelem"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-types">Private Types</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classmlpack_1_1tree_1_1DecisionTree-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This class implements a generic decision tree learner.
<a href="classmlpack_1_1tree_1_1DecisionTree.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classmlpack_1_1tree_1_1DecisionTree__inherit__graph.png" border="0" usemap="#mlpack_1_1tree_1_1DecisionTree_3_01FitnessFunction_00_01NumericSplitType_00_01CategoricalSplitType_00_01ElemType_00_01NoRecursion_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="mlpack_1_1tree_1_1DecisionTree_3_01FitnessFunction_00_01NumericSplitType_00_01CategoricalSplitType_00_01ElemType_00_01NoRecursion_01_4_inherit__map" id="mlpack_1_1tree_1_1DecisionTree_3_01FitnessFunction_00_01NumericSplitType_00_01CategoricalSplitType_00_01ElemType_00_01NoRecursion_01_4_inherit__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a47c926608af4037637e7a71b2788c780"><td class="memItemLeft" align="right" valign="top">typedef CategoricalSplitType&lt; FitnessFunction &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a47c926608af4037637e7a71b2788c780">CategoricalSplit</a></td></tr>
<tr class="memdesc:a47c926608af4037637e7a71b2788c780"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allow access to the categorical split type. <a href="#a47c926608af4037637e7a71b2788c780">More...</a><br /></td></tr>
<tr class="separator:a47c926608af4037637e7a71b2788c780"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa0076abd32aae8eb6bc04d98b843faf"><td class="memItemLeft" align="right" valign="top">typedef NumericSplitType&lt; FitnessFunction &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#aaa0076abd32aae8eb6bc04d98b843faf">NumericSplit</a></td></tr>
<tr class="memdesc:aaa0076abd32aae8eb6bc04d98b843faf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allow access to the numeric split type. <a href="#aaa0076abd32aae8eb6bc04d98b843faf">More...</a><br /></td></tr>
<tr class="separator:aaa0076abd32aae8eb6bc04d98b843faf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8895e26a965b754ac13b1aee3babfcfc"><td class="memTemplParams" colspan="2">template&lt;typename MatType &gt; </td></tr>
<tr class="memitem:a8895e26a965b754ac13b1aee3babfcfc"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a8895e26a965b754ac13b1aee3babfcfc">DecisionTree</a> (const MatType &amp;data, const <a class="el" href="namespacemlpack_1_1data.html#a78dcb1509876d801331776f0b895cffb">data::DatasetInfo</a> &amp;datasetInfo, const arma::Row&lt; size_t &gt; &amp;labels, const size_t numClasses, const size_t minimumLeafSize=10)</td></tr>
<tr class="memdesc:a8895e26a965b754ac13b1aee3babfcfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the decision tree on the given data and labels, where the data can be both numeric and categorical. <a href="#a8895e26a965b754ac13b1aee3babfcfc">More...</a><br /></td></tr>
<tr class="separator:a8895e26a965b754ac13b1aee3babfcfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab948c4e515d0a7e408a57a619f3e2b30"><td class="memTemplParams" colspan="2">template&lt;typename MatType &gt; </td></tr>
<tr class="memitem:ab948c4e515d0a7e408a57a619f3e2b30"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#ab948c4e515d0a7e408a57a619f3e2b30">DecisionTree</a> (const MatType &amp;data, const arma::Row&lt; size_t &gt; &amp;labels, const size_t numClasses, const size_t minimumLeafSize=10)</td></tr>
<tr class="memdesc:ab948c4e515d0a7e408a57a619f3e2b30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the decision tree on the given data and labels, assuming that the data is all of the numeric type. <a href="#ab948c4e515d0a7e408a57a619f3e2b30">More...</a><br /></td></tr>
<tr class="separator:ab948c4e515d0a7e408a57a619f3e2b30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b09eaa85d0595870a291d435c0786b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a10b09eaa85d0595870a291d435c0786b">DecisionTree</a> (const size_t numClasses=1)</td></tr>
<tr class="memdesc:a10b09eaa85d0595870a291d435c0786b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a decision tree without training it. <a href="#a10b09eaa85d0595870a291d435c0786b">More...</a><br /></td></tr>
<tr class="separator:a10b09eaa85d0595870a291d435c0786b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8499fb249fdc5d2f736a90bf774c6a83"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a8499fb249fdc5d2f736a90bf774c6a83">DecisionTree</a> (const <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;other)</td></tr>
<tr class="memdesc:a8499fb249fdc5d2f736a90bf774c6a83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy another tree. <a href="#a8499fb249fdc5d2f736a90bf774c6a83">More...</a><br /></td></tr>
<tr class="separator:a8499fb249fdc5d2f736a90bf774c6a83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8effda63202a42eb02c59da4f19c4324"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a8effda63202a42eb02c59da4f19c4324">DecisionTree</a> (<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;&amp;other)</td></tr>
<tr class="memdesc:a8effda63202a42eb02c59da4f19c4324"><td class="mdescLeft">&#160;</td><td class="mdescRight">Take ownership of another tree. <a href="#a8effda63202a42eb02c59da4f19c4324">More...</a><br /></td></tr>
<tr class="separator:a8effda63202a42eb02c59da4f19c4324"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f944c4f36862ab630f8723c5d3f8ee9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a7f944c4f36862ab630f8723c5d3f8ee9">~DecisionTree</a> ()</td></tr>
<tr class="memdesc:a7f944c4f36862ab630f8723c5d3f8ee9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clean up memory. <a href="#a7f944c4f36862ab630f8723c5d3f8ee9">More...</a><br /></td></tr>
<tr class="separator:a7f944c4f36862ab630f8723c5d3f8ee9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09ecf7d2d8a1ff6e74d634c1153909c7"><td class="memTemplParams" colspan="2">template&lt;typename VecType &gt; </td></tr>
<tr class="memitem:a09ecf7d2d8a1ff6e74d634c1153909c7"><td class="memTemplItemLeft" align="right" valign="top">size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a09ecf7d2d8a1ff6e74d634c1153909c7">CalculateDirection</a> (const VecType &amp;point) const </td></tr>
<tr class="memdesc:a09ecf7d2d8a1ff6e74d634c1153909c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given a point and that this node is not a leaf, calculate the index of the child node this point would go towards. <a href="#a09ecf7d2d8a1ff6e74d634c1153909c7">More...</a><br /></td></tr>
<tr class="separator:a09ecf7d2d8a1ff6e74d634c1153909c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb477016c1ef13959ab35b025c6fa97c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#abb477016c1ef13959ab35b025c6fa97c">Child</a> (const size_t i) const </td></tr>
<tr class="memdesc:abb477016c1ef13959ab35b025c6fa97c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the child of the given index. <a href="#abb477016c1ef13959ab35b025c6fa97c">More...</a><br /></td></tr>
<tr class="separator:abb477016c1ef13959ab35b025c6fa97c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d24d8ce5ccadbc604f4d1bf41e87449"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a5d24d8ce5ccadbc604f4d1bf41e87449">Child</a> (const size_t i)</td></tr>
<tr class="memdesc:a5d24d8ce5ccadbc604f4d1bf41e87449"><td class="mdescLeft">&#160;</td><td class="mdescRight">Modify the child of the given index (be careful!). <a href="#a5d24d8ce5ccadbc604f4d1bf41e87449">More...</a><br /></td></tr>
<tr class="separator:a5d24d8ce5ccadbc604f4d1bf41e87449"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81d8d5e76ac1b6c58341a007290847b6"><td class="memTemplParams" colspan="2">template&lt;typename VecType &gt; </td></tr>
<tr class="memitem:a81d8d5e76ac1b6c58341a007290847b6"><td class="memTemplItemLeft" align="right" valign="top">size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a81d8d5e76ac1b6c58341a007290847b6">Classify</a> (const VecType &amp;point) const </td></tr>
<tr class="memdesc:a81d8d5e76ac1b6c58341a007290847b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Classify the given point, using the entire tree. <a href="#a81d8d5e76ac1b6c58341a007290847b6">More...</a><br /></td></tr>
<tr class="separator:a81d8d5e76ac1b6c58341a007290847b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90a8af18c9cc6ef861910e7e4bd72836"><td class="memTemplParams" colspan="2">template&lt;typename VecType &gt; </td></tr>
<tr class="memitem:a90a8af18c9cc6ef861910e7e4bd72836"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a90a8af18c9cc6ef861910e7e4bd72836">Classify</a> (const VecType &amp;point, size_t &amp;prediction, arma::vec &amp;probabilities) const </td></tr>
<tr class="memdesc:a90a8af18c9cc6ef861910e7e4bd72836"><td class="mdescLeft">&#160;</td><td class="mdescRight">Classify the given point and also return estimates of the probability for each class in the given vector. <a href="#a90a8af18c9cc6ef861910e7e4bd72836">More...</a><br /></td></tr>
<tr class="separator:a90a8af18c9cc6ef861910e7e4bd72836"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0cc8eebf3a189c0e3d622b5ebcfb533"><td class="memTemplParams" colspan="2">template&lt;typename MatType &gt; </td></tr>
<tr class="memitem:ad0cc8eebf3a189c0e3d622b5ebcfb533"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#ad0cc8eebf3a189c0e3d622b5ebcfb533">Classify</a> (const MatType &amp;data, arma::Row&lt; size_t &gt; &amp;predictions) const </td></tr>
<tr class="memdesc:ad0cc8eebf3a189c0e3d622b5ebcfb533"><td class="mdescLeft">&#160;</td><td class="mdescRight">Classify the given points, using the entire tree. <a href="#ad0cc8eebf3a189c0e3d622b5ebcfb533">More...</a><br /></td></tr>
<tr class="separator:ad0cc8eebf3a189c0e3d622b5ebcfb533"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38f3c4ec0b12ea08b4e3a4b06fc2ac8e"><td class="memTemplParams" colspan="2">template&lt;typename MatType &gt; </td></tr>
<tr class="memitem:a38f3c4ec0b12ea08b4e3a4b06fc2ac8e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a38f3c4ec0b12ea08b4e3a4b06fc2ac8e">Classify</a> (const MatType &amp;data, arma::Row&lt; size_t &gt; &amp;predictions, arma::mat &amp;probabilities) const </td></tr>
<tr class="memdesc:a38f3c4ec0b12ea08b4e3a4b06fc2ac8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Classify the given points and also return estimates of the probabilities for each class in the given matrix. <a href="#a38f3c4ec0b12ea08b4e3a4b06fc2ac8e">More...</a><br /></td></tr>
<tr class="separator:a38f3c4ec0b12ea08b4e3a4b06fc2ac8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51b2801e7255ae796517583a04cf41cc"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a51b2801e7255ae796517583a04cf41cc">NumChildren</a> () const </td></tr>
<tr class="memdesc:a51b2801e7255ae796517583a04cf41cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of children. <a href="#a51b2801e7255ae796517583a04cf41cc">More...</a><br /></td></tr>
<tr class="separator:a51b2801e7255ae796517583a04cf41cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9a0efae345916db75d4de55ee800d0d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#af9a0efae345916db75d4de55ee800d0d">operator=</a> (const <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;other)</td></tr>
<tr class="memdesc:af9a0efae345916db75d4de55ee800d0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy another tree. <a href="#af9a0efae345916db75d4de55ee800d0d">More...</a><br /></td></tr>
<tr class="separator:af9a0efae345916db75d4de55ee800d0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a532bee1a4131f0a4212737efec22252d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a532bee1a4131f0a4212737efec22252d">operator=</a> (<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> &amp;&amp;other)</td></tr>
<tr class="memdesc:a532bee1a4131f0a4212737efec22252d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Take ownership of another tree. <a href="#a532bee1a4131f0a4212737efec22252d">More...</a><br /></td></tr>
<tr class="separator:a532bee1a4131f0a4212737efec22252d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4372a14aa83472be410486c299990816"><td class="memTemplParams" colspan="2">template&lt;typename Archive &gt; </td></tr>
<tr class="memitem:a4372a14aa83472be410486c299990816"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a4372a14aa83472be410486c299990816">Serialize</a> (Archive &amp;ar, const unsigned int)</td></tr>
<tr class="memdesc:a4372a14aa83472be410486c299990816"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialize the tree. <a href="#a4372a14aa83472be410486c299990816">More...</a><br /></td></tr>
<tr class="separator:a4372a14aa83472be410486c299990816"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a56744b932b6e6c78b4975c9e355896"><td class="memTemplParams" colspan="2">template&lt;typename MatType &gt; </td></tr>
<tr class="memitem:a9a56744b932b6e6c78b4975c9e355896"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a9a56744b932b6e6c78b4975c9e355896">Train</a> (const MatType &amp;data, const <a class="el" href="namespacemlpack_1_1data.html#a78dcb1509876d801331776f0b895cffb">data::DatasetInfo</a> &amp;datasetInfo, const arma::Row&lt; size_t &gt; &amp;labels, const size_t numClasses, const size_t minimumLeafSize=10)</td></tr>
<tr class="memdesc:a9a56744b932b6e6c78b4975c9e355896"><td class="mdescLeft">&#160;</td><td class="mdescRight">Train the decision tree on the given data. <a href="#a9a56744b932b6e6c78b4975c9e355896">More...</a><br /></td></tr>
<tr class="separator:a9a56744b932b6e6c78b4975c9e355896"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16dabe71c1e67e98fd44fb5322134deb"><td class="memTemplParams" colspan="2">template&lt;typename MatType &gt; </td></tr>
<tr class="memitem:a16dabe71c1e67e98fd44fb5322134deb"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a16dabe71c1e67e98fd44fb5322134deb">Train</a> (const MatType &amp;data, const arma::Row&lt; size_t &gt; &amp;labels, const size_t numClasses, const size_t minimumLeafSize=10)</td></tr>
<tr class="memdesc:a16dabe71c1e67e98fd44fb5322134deb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Train the decision tree on the given data, assuming that all dimensions are numeric. <a href="#a16dabe71c1e67e98fd44fb5322134deb">More...</a><br /></td></tr>
<tr class="separator:a16dabe71c1e67e98fd44fb5322134deb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-types"></a>
Private Types</h2></td></tr>
<tr class="memitem:a8f71e2e71f5b875fe1b6b6e3b2286358"><td class="memItemLeft" align="right" valign="top">typedef CategoricalSplit::template AuxiliarySplitInfo&lt; ElemType &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a8f71e2e71f5b875fe1b6b6e3b2286358">CategoricalAuxiliarySplitInfo</a></td></tr>
<tr class="separator:a8f71e2e71f5b875fe1b6b6e3b2286358"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa53d2150636d2e7d4dfde8030e7377d"><td class="memItemLeft" align="right" valign="top">typedef NumericSplit::template AuxiliarySplitInfo&lt; ElemType &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#aaa53d2150636d2e7d4dfde8030e7377d">NumericAuxiliarySplitInfo</a></td></tr>
<tr class="memdesc:aaa53d2150636d2e7d4dfde8030e7377d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Note that this class will also hold the members of the NumericSplit and CategoricalSplit AuxiliarySplitInfo classes, since it inherits from them. <a href="#aaa53d2150636d2e7d4dfde8030e7377d">More...</a><br /></td></tr>
<tr class="separator:aaa53d2150636d2e7d4dfde8030e7377d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:abaae8925e6735cfeb99a4ab5ebcf4ca3"><td class="memTemplParams" colspan="2">template&lt;typename RowType &gt; </td></tr>
<tr class="memitem:abaae8925e6735cfeb99a4ab5ebcf4ca3"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#abaae8925e6735cfeb99a4ab5ebcf4ca3">CalculateClassProbabilities</a> (const RowType &amp;labels, const size_t numClasses)</td></tr>
<tr class="memdesc:abaae8925e6735cfeb99a4ab5ebcf4ca3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the class probabilities of the given labels. <a href="#abaae8925e6735cfeb99a4ab5ebcf4ca3">More...</a><br /></td></tr>
<tr class="separator:abaae8925e6735cfeb99a4ab5ebcf4ca3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a3743ab3245d148f78817f5d1b812f6e8"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a3743ab3245d148f78817f5d1b812f6e8">children</a></td></tr>
<tr class="memdesc:a3743ab3245d148f78817f5d1b812f6e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">The vector of children. <a href="#a3743ab3245d148f78817f5d1b812f6e8">More...</a><br /></td></tr>
<tr class="separator:a3743ab3245d148f78817f5d1b812f6e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b014767c5983cc9dcc3564e6167e2d1"><td class="memItemLeft" align="right" valign="top">arma::vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a9b014767c5983cc9dcc3564e6167e2d1">classProbabilities</a></td></tr>
<tr class="memdesc:a9b014767c5983cc9dcc3564e6167e2d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This vector may hold different things. <a href="#a9b014767c5983cc9dcc3564e6167e2d1">More...</a><br /></td></tr>
<tr class="separator:a9b014767c5983cc9dcc3564e6167e2d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8550c35ef6755b61d2467aa1347f4a6"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#aa8550c35ef6755b61d2467aa1347f4a6">dimensionTypeOrMajorityClass</a></td></tr>
<tr class="memdesc:aa8550c35ef6755b61d2467aa1347f4a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of the dimension that we have split on (if we are not a leaf). <a href="#aa8550c35ef6755b61d2467aa1347f4a6">More...</a><br /></td></tr>
<tr class="separator:aa8550c35ef6755b61d2467aa1347f4a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb83dcda9656c66d0bff4f347d5e0a98"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#acb83dcda9656c66d0bff4f347d5e0a98">splitDimension</a></td></tr>
<tr class="memdesc:acb83dcda9656c66d0bff4f347d5e0a98"><td class="mdescLeft">&#160;</td><td class="mdescRight">The dimension this node splits on. <a href="#acb83dcda9656c66d0bff4f347d5e0a98">More...</a><br /></td></tr>
<tr class="separator:acb83dcda9656c66d0bff4f347d5e0a98"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt;<br />
class mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;</h3>
<p>This class implements a generic decision tree learner. </p>
<p>Its behavior can be controlled via its template arguments.</p>
<p>The class inherits from the auxiliary split information in order to prevent an empty auxiliary split information struct from taking any extra size. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00031">31</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="a8f71e2e71f5b875fe1b6b6e3b2286358"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">typedef CategoricalSplit::template AuxiliarySplitInfo&lt;ElemType&gt; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a8f71e2e71f5b875fe1b6b6e3b2286358">CategoricalAuxiliarySplitInfo</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00254">254</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a47c926608af4037637e7a71b2788c780"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname">typedef CategoricalSplitType&lt;FitnessFunction&gt; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a47c926608af4037637e7a71b2788c780">CategoricalSplit</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allow access to the categorical split type. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00041">41</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaa53d2150636d2e7d4dfde8030e7377d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">typedef NumericSplit::template AuxiliarySplitInfo&lt;ElemType&gt; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#aaa53d2150636d2e7d4dfde8030e7377d">NumericAuxiliarySplitInfo</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Note that this class will also hold the members of the NumericSplit and CategoricalSplit AuxiliarySplitInfo classes, since it inherits from them. </p>
<p>We'll define some convenience typedefs here. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00252">252</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaa0076abd32aae8eb6bc04d98b843faf"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname">typedef NumericSplitType&lt;FitnessFunction&gt; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#aaa0076abd32aae8eb6bc04d98b843faf">NumericSplit</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allow access to the numeric split type. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00039">39</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a8895e26a965b754ac13b1aee3babfcfc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename MatType &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacemlpack_1_1data.html#a78dcb1509876d801331776f0b895cffb">data::DatasetInfo</a> &amp;&#160;</td>
<td class="paramname"><em>datasetInfo</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>labels</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>minimumLeafSize</em> = <code>10</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct the decision tree on the given data and labels, where the data can be both numeric and categorical. </p>
<p>Setting minimumLeafSize too small may cause the tree to overfit, but setting it too large may cause it to underfit.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Dataset to train on. </td></tr>
<tr><td class="paramname">datasetInfo</td><td>Type information for each dimension of the dataset. </td></tr>
<tr><td class="paramname">labels</td><td>Labels for each training point. </td></tr>
<tr><td class="paramname">numClasses</td><td>Number of classes in the dataset. </td></tr>
<tr><td class="paramname">minimumLeafSize</td><td>Minimum number of points in each leaf node. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab948c4e515d0a7e408a57a619f3e2b30"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename MatType &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>labels</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>minimumLeafSize</em> = <code>10</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct the decision tree on the given data and labels, assuming that the data is all of the numeric type. </p>
<p>Setting minimumLeafSize too small may cause the tree to overfit, but setting it too large may cause it to underfit.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Dataset to train on. </td></tr>
<tr><td class="paramname">labels</td><td>Labels for each training point. </td></tr>
<tr><td class="paramname">numClasses</td><td>Number of classes in the dataset. </td></tr>
<tr><td class="paramname">minimumLeafSize</td><td>Minimum number of points in each leaf node. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a10b09eaa85d0595870a291d435c0786b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> </td>
<td>(</td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em> = <code>1</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct a decision tree without training it. </p>
<p>It will be a leaf node with equal probabilities for each class.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">numClasses</td><td>Number of classes in the dataset. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8499fb249fdc5d2f736a90bf774c6a83"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt; &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy another tree. </p>
<p>This may use a lot of memory&mdash;be sure that it's what you want to do.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>Tree to copy. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8effda63202a42eb02c59da4f19c4324"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt; &amp;&amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Take ownership of another tree. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>Tree to take ownership of. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a7f944c4f36862ab630f8723c5d3f8ee9"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::~<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Clean up memory. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="abaae8925e6735cfeb99a4ab5ebcf4ca3"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename RowType &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::CalculateClassProbabilities </td>
<td>(</td>
<td class="paramtype">const RowType &amp;&#160;</td>
<td class="paramname"><em>labels</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Calculate the class probabilities of the given labels. </p>
</div>
</div>
<a class="anchor" id="a09ecf7d2d8a1ff6e74d634c1153909c7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename VecType &gt; </div>
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::CalculateDirection </td>
<td>(</td>
<td class="paramtype">const VecType &amp;&#160;</td>
<td class="paramname"><em>point</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Given a point and that this node is not a leaf, calculate the index of the child node this point would go towards. </p>
<p>This method is primarily used by the <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a81d8d5e76ac1b6c58341a007290847b6" title="Classify the given point, using the entire tree. ">Classify()</a> function, but it can be used in a standalone sense too.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">point</td><td>Point to classify. </td></tr>
</table>
</dd>
</dl>
<p>Referenced by <a class="el" href="decision__tree_8hpp_source.html#l00219">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Child()</a>.</p>
</div>
</div>
<a class="anchor" id="abb477016c1ef13959ab35b025c6fa97c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&amp; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Child </td>
<td>(</td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the child of the given index. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00217">217</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
<p>References <a class="el" href="decision__tree_8hpp_source.html#l00233">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::children</a>.</p>
</div>
</div>
<a class="anchor" id="a5d24d8ce5ccadbc604f4d1bf41e87449"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&amp; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Child </td>
<td>(</td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Modify the child of the given index (be careful!). </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00219">219</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
<p>References <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a09ecf7d2d8a1ff6e74d634c1153909c7">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::CalculateDirection()</a>, and <a class="el" href="decision__tree_8hpp_source.html#l00233">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::children</a>.</p>
</div>
</div>
<a class="anchor" id="a81d8d5e76ac1b6c58341a007290847b6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename VecType &gt; </div>
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Classify </td>
<td>(</td>
<td class="paramtype">const VecType &amp;&#160;</td>
<td class="paramname"><em>point</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Classify the given point, using the entire tree. </p>
<p>The predicted label is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">point</td><td>Point to classify. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a90a8af18c9cc6ef861910e7e4bd72836"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename VecType &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Classify </td>
<td>(</td>
<td class="paramtype">const VecType &amp;&#160;</td>
<td class="paramname"><em>point</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t &amp;&#160;</td>
<td class="paramname"><em>prediction</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">arma::vec &amp;&#160;</td>
<td class="paramname"><em>probabilities</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Classify the given point and also return estimates of the probability for each class in the given vector. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">point</td><td>Point to classify. </td></tr>
<tr><td class="paramname">prediction</td><td>This will be set to the predicted class of the point. </td></tr>
<tr><td class="paramname">probabilities</td><td>This will be filled with class probabilities for the point. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad0cc8eebf3a189c0e3d622b5ebcfb533"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename MatType &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Classify </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>predictions</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Classify the given points, using the entire tree. </p>
<p>The predicted labels for each point are stored in the given vector.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Set of points to classify. </td></tr>
<tr><td class="paramname">predictions</td><td>This will be filled with predictions for each point. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a38f3c4ec0b12ea08b4e3a4b06fc2ac8e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename MatType &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Classify </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>predictions</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">arma::mat &amp;&#160;</td>
<td class="paramname"><em>probabilities</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Classify the given points and also return estimates of the probabilities for each class in the given matrix. </p>
<p>The predicted labels for each point are stored in the given vector.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Set of points to classify. </td></tr>
<tr><td class="paramname">predictions</td><td>This will be filled with predictions for each point. </td></tr>
<tr><td class="paramname">probabilities</td><td>This will be filled with class probabilities for each point. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a51b2801e7255ae796517583a04cf41cc"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::NumChildren </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the number of children. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00214">214</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
<p>References <a class="el" href="decision__tree_8hpp_source.html#l00233">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::children</a>.</p>
</div>
</div>
<a class="anchor" id="af9a0efae345916db75d4de55ee800d0d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&amp; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt; &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy another tree. </p>
<p>This may use a lot of memory&mdash;be sure that it's what you want to do.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>Tree to copy. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a532bee1a4131f0a4212737efec22252d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&amp; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt; &amp;&amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Take ownership of another tree. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>Tree to take ownership of. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a4372a14aa83472be410486c299990816"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename Archive &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Serialize </td>
<td>(</td>
<td class="paramtype">Archive &amp;&#160;</td>
<td class="paramname"><em>ar</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const unsigned&#160;</td>
<td class="paramname"><em>int</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Serialize the tree. </p>
</div>
</div>
<a class="anchor" id="a9a56744b932b6e6c78b4975c9e355896"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename MatType &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Train </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacemlpack_1_1data.html#a78dcb1509876d801331776f0b895cffb">data::DatasetInfo</a> &amp;&#160;</td>
<td class="paramname"><em>datasetInfo</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>labels</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>minimumLeafSize</em> = <code>10</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Train the decision tree on the given data. </p>
<p>This will overwrite the existing model. The data may have numeric and categorical types, specified by the datasetInfo parameter. Setting minimumLeafSize too small may cause the tree to overfit, but setting it too large may cause it to underfit.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Dataset to train on. </td></tr>
<tr><td class="paramname">datasetInfo</td><td>Type information for each dimension. </td></tr>
<tr><td class="paramname">labels</td><td>Labels for each training point. </td></tr>
<tr><td class="paramname">numClasses</td><td>Number of classes in the dataset. </td></tr>
<tr><td class="paramname">minimumLeafSize</td><td>Minimum number of points in each leaf node. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a16dabe71c1e67e98fd44fb5322134deb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<div class="memtemplate">
template&lt;typename MatType &gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Train </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>labels</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>minimumLeafSize</em> = <code>10</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Train the decision tree on the given data, assuming that all dimensions are numeric. </p>
<p>This will overwrite the given model. Setting minimumLeafSize too small may cause the tree to overfit, but setting it too large may cause it to underfit.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Dataset to train on. </td></tr>
<tr><td class="paramname">labels</td><td>Labels for each training point. </td></tr>
<tr><td class="paramname">numClasses</td><td>Number of classes in the dataset. </td></tr>
<tr><td class="paramname">minimumLeafSize</td><td>Minimum number of points in each leaf node. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a3743ab3245d148f78817f5d1b812f6e8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">DecisionTree</a>*&gt; <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::children</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The vector of children. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00233">233</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
<p>Referenced by <a class="el" href="decision__tree_8hpp_source.html#l00217">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::Child()</a>, and <a class="el" href="decision__tree_8hpp_source.html#l00214">mlpack::tree::DecisionTree&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::NumChildren()</a>.</p>
</div>
</div>
<a class="anchor" id="a9b014767c5983cc9dcc3564e6167e2d1"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">arma::vec <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::classProbabilities</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This vector may hold different things. </p>
<p>If the node has no children, then it is guaranteed to hold the probabilities of each class. If the node has children, then it may be used arbitrarily by the split type's <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html#a09ecf7d2d8a1ff6e74d634c1153909c7" title="Given a point and that this node is not a leaf, calculate the index of the child node this point woul...">CalculateDirection()</a> function and may not necessarily hold class probabilities. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00246">246</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa8550c35ef6755b61d2467aa1347f4a6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::dimensionTypeOrMajorityClass</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The type of the dimension that we have split on (if we are not a leaf). </p>
<p>If we are a leaf, then this is the index of the majority class. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00238">238</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="acb83dcda9656c66d0bff4f347d5e0a98"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction = GiniGain, template&lt; typename &gt; class NumericSplitType = BestBinaryNumericSplit, template&lt; typename &gt; class CategoricalSplitType = AllCategoricalSplit, typename ElemType = double, bool NoRecursion = false&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1DecisionTree.html">mlpack::tree::DecisionTree</a>&lt; FitnessFunction, NumericSplitType, CategoricalSplitType, ElemType, NoRecursion &gt;::splitDimension</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The dimension this node splits on. </p>
<p>Definition at line <a class="el" href="decision__tree_8hpp_source.html#l00235">235</a> of file <a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/mlpack/methods/decision_tree/<a class="el" href="decision__tree_8hpp_source.html">decision_tree.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
<script type="text/javascript">
var x = document.getElementsByClassName("formulaDsp");
var i;
for (i = 0; i < x.length; i++)
{
x[i].width /= 4;
}
</script>
</html>