Files
mlpack/doc/html/classmlpack_1_1tree_1_1BinaryNumericSplit.html
T

595 lines
36 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::BinaryNumericSplit&lt; FitnessFunction, ObservationType &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_1BinaryNumericSplit.html">BinaryNumericSplit</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-attribs">Private Attributes</a> &#124;
<a href="classmlpack_1_1tree_1_1BinaryNumericSplit-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>The <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a> class implements the numeric feature splitting strategy devised by Gama, Rocha, and Medas in the following paper:
<a href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#details">More...</a></p>
<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:aee2d439f8cca76ded95b74c5afa26cfb"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplitInfo.html">BinaryNumericSplitInfo</a>&lt; ObservationType &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#aee2d439f8cca76ded95b74c5afa26cfb">SplitInfo</a></td></tr>
<tr class="memdesc:aee2d439f8cca76ded95b74c5afa26cfb"><td class="mdescLeft">&#160;</td><td class="mdescRight">The splitting information required by the <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a>. <a href="#aee2d439f8cca76ded95b74c5afa26cfb">More...</a><br /></td></tr>
<tr class="separator:aee2d439f8cca76ded95b74c5afa26cfb"><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:abc8708f69f59cfc58cc6a1b13d34129a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#abc8708f69f59cfc58cc6a1b13d34129a">BinaryNumericSplit</a> (const size_t numClasses)</td></tr>
<tr class="memdesc:abc8708f69f59cfc58cc6a1b13d34129a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create the <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a> object with the given number of classes. <a href="#abc8708f69f59cfc58cc6a1b13d34129a">More...</a><br /></td></tr>
<tr class="separator:abc8708f69f59cfc58cc6a1b13d34129a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb8992a07351522a4511b549041aa0f8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#adb8992a07351522a4511b549041aa0f8">BinaryNumericSplit</a> (const size_t numClasses, const <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">BinaryNumericSplit</a> &amp;other)</td></tr>
<tr class="memdesc:adb8992a07351522a4511b549041aa0f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create the <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a> object with the given number of classes, using information from the given other split for other parameters. <a href="#adb8992a07351522a4511b549041aa0f8">More...</a><br /></td></tr>
<tr class="separator:adb8992a07351522a4511b549041aa0f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d64c6c75adba844168cbbe307efde4c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a4d64c6c75adba844168cbbe307efde4c">EvaluateFitnessFunction</a> (double &amp;bestFitness, double &amp;secondBestFitness)</td></tr>
<tr class="memdesc:a4d64c6c75adba844168cbbe307efde4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given the points seen so far, evaluate the fitness function, returning the best possible gain of a binary split. <a href="#a4d64c6c75adba844168cbbe307efde4c">More...</a><br /></td></tr>
<tr class="separator:a4d64c6c75adba844168cbbe307efde4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37769243377056af37b41adfec46b8bd"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a37769243377056af37b41adfec46b8bd">MajorityClass</a> () const </td></tr>
<tr class="memdesc:a37769243377056af37b41adfec46b8bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">The majority class of the points seen so far. <a href="#a37769243377056af37b41adfec46b8bd">More...</a><br /></td></tr>
<tr class="separator:a37769243377056af37b41adfec46b8bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49c45c24bba4a46094664ac806701320"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a49c45c24bba4a46094664ac806701320">MajorityProbability</a> () const </td></tr>
<tr class="memdesc:a49c45c24bba4a46094664ac806701320"><td class="mdescLeft">&#160;</td><td class="mdescRight">The probability of the majority class given the points seen so far. <a href="#a49c45c24bba4a46094664ac806701320">More...</a><br /></td></tr>
<tr class="separator:a49c45c24bba4a46094664ac806701320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad812be693521007d13f9022f3dcc40fd"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#ad812be693521007d13f9022f3dcc40fd">NumChildren</a> () const </td></tr>
<tr class="separator:ad812be693521007d13f9022f3dcc40fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada680ee52b021bbfdd64d76c8943048c"><td class="memTemplParams" colspan="2">template&lt;typename Archive &gt; </td></tr>
<tr class="memitem:ada680ee52b021bbfdd64d76c8943048c"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#ada680ee52b021bbfdd64d76c8943048c">Serialize</a> (Archive &amp;ar, const unsigned int)</td></tr>
<tr class="memdesc:ada680ee52b021bbfdd64d76c8943048c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialize the object. <a href="#ada680ee52b021bbfdd64d76c8943048c">More...</a><br /></td></tr>
<tr class="separator:ada680ee52b021bbfdd64d76c8943048c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3613e157797f9f591c99671211cea694"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a3613e157797f9f591c99671211cea694">Split</a> (arma::Col&lt; size_t &gt; &amp;childMajorities, <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#aee2d439f8cca76ded95b74c5afa26cfb">SplitInfo</a> &amp;splitInfo)</td></tr>
<tr class="memdesc:a3613e157797f9f591c99671211cea694"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given that a split should happen, return the majority classes of the (two) children and an initialized SplitInfo object. <a href="#a3613e157797f9f591c99671211cea694">More...</a><br /></td></tr>
<tr class="separator:a3613e157797f9f591c99671211cea694"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abeaea8895e56f89904f83793e434fbb3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#abeaea8895e56f89904f83793e434fbb3">Train</a> (ObservationType value, const size_t label)</td></tr>
<tr class="memdesc:abeaea8895e56f89904f83793e434fbb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Train on the given value with the given label. <a href="#abeaea8895e56f89904f83793e434fbb3">More...</a><br /></td></tr>
<tr class="separator:abeaea8895e56f89904f83793e434fbb3"><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:a45b02598ef3670b154fdf1ff82189f2f"><td class="memItemLeft" align="right" valign="top">ObservationType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a45b02598ef3670b154fdf1ff82189f2f">bestSplit</a></td></tr>
<tr class="memdesc:a45b02598ef3670b154fdf1ff82189f2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">A cached best split point. <a href="#a45b02598ef3670b154fdf1ff82189f2f">More...</a><br /></td></tr>
<tr class="separator:a45b02598ef3670b154fdf1ff82189f2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa7a1cca0466ba96e7f8e12f50b0d721"><td class="memItemLeft" align="right" valign="top">arma::Col&lt; size_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#afa7a1cca0466ba96e7f8e12f50b0d721">classCounts</a></td></tr>
<tr class="memdesc:afa7a1cca0466ba96e7f8e12f50b0d721"><td class="mdescLeft">&#160;</td><td class="mdescRight">The classes we have seen so far (for majority calculations). <a href="#afa7a1cca0466ba96e7f8e12f50b0d721">More...</a><br /></td></tr>
<tr class="separator:afa7a1cca0466ba96e7f8e12f50b0d721"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae930b1c38e4dd56cdc012b2b64da4877"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#ae930b1c38e4dd56cdc012b2b64da4877">isAccurate</a></td></tr>
<tr class="memdesc:ae930b1c38e4dd56cdc012b2b64da4877"><td class="mdescLeft">&#160;</td><td class="mdescRight">If true, the cached best split point is accurate (that is, we have not seen any more samples since we calculated it). <a href="#ae930b1c38e4dd56cdc012b2b64da4877">More...</a><br /></td></tr>
<tr class="separator:ae930b1c38e4dd56cdc012b2b64da4877"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a327b0e3094b57b69401e7ca27321ed72"><td class="memItemLeft" align="right" valign="top">std::multimap&lt; ObservationType, size_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a327b0e3094b57b69401e7ca27321ed72">sortedElements</a></td></tr>
<tr class="memdesc:a327b0e3094b57b69401e7ca27321ed72"><td class="mdescLeft">&#160;</td><td class="mdescRight">The elements seen so far, in sorted order. <a href="#a327b0e3094b57b69401e7ca27321ed72">More...</a><br /></td></tr>
<tr class="separator:a327b0e3094b57b69401e7ca27321ed72"><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, typename ObservationType = double&gt;<br />
class mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;</h3>
<p>The <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a> class implements the numeric feature splitting strategy devised by Gama, Rocha, and Medas in the following paper: </p>
<div class="fragment"><div class="line">@inproceedings{gama2003accurate,</div><div class="line"> title={Accurate Decision Trees <span class="keywordflow">for</span> Mining High-Speed Data Streams},</div><div class="line"> author={Gama, J. and Rocha, R. and Medas, P.},</div><div class="line"> year={2003},</div><div class="line"> booktitle={Proceedings of the Ninth ACM SIGKDD International Conference on</div><div class="line"> Knowledge Discovery and Data Mining (KDD <span class="stringliteral">&#39;03)},</span></div><div class="line"><span class="stringliteral"> pages={523--528}</span></div><div class="line"><span class="stringliteral">}</span></div></div><!-- fragment --><p>This splitting procedure builds a binary tree on points it has seen so far, and then <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a4d64c6c75adba844168cbbe307efde4c" title="Given the points seen so far, evaluate the fitness function, returning the best possible gain of a bi...">EvaluateFitnessFunction()</a> 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 <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#abeaea8895e56f89904f83793e434fbb3" title="Train on the given value with the given label. ">Train()</a> function should take O(1) time.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">FitnessFunction</td><td>Fitness function to use for calculating gain. </td></tr>
<tr><td class="paramname">ObservationType</td><td>Type of observation used by this dimension. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00047">47</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="aee2d439f8cca76ded95b74c5afa26cfb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplitInfo.html">BinaryNumericSplitInfo</a>&lt;ObservationType&gt; <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::<a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#aee2d439f8cca76ded95b74c5afa26cfb">SplitInfo</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The splitting information required by the <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a>. </p>
<p>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00051">51</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abc8708f69f59cfc58cc6a1b13d34129a"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::<a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">BinaryNumericSplit</a> </td>
<td>(</td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>numClasses</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create the <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a> object with the given number of classes. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">numClasses</td><td>Number of classes in dataset. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="adb8992a07351522a4511b549041aa0f8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::<a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">BinaryNumericSplit</a> </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 <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt; &amp;&#160;</td>
<td class="paramname"><em>other</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create the <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html" title="The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...">BinaryNumericSplit</a> object with the given number of classes, using information from the given other split for other parameters. </p>
<p>In this case, there are no other parameters, but this function is required by the <a class="el" href="classmlpack_1_1tree_1_1HoeffdingTree.html" title="The HoeffdingTree object represents all of the necessary information for a Hoeffding-bound-based deci...">HoeffdingTree</a> class. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a4d64c6c75adba844168cbbe307efde4c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::EvaluateFitnessFunction </td>
<td>(</td>
<td class="paramtype">double &amp;&#160;</td>
<td class="paramname"><em>bestFitness</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double &amp;&#160;</td>
<td class="paramname"><em>secondBestFitness</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Given the points seen so far, evaluate the fitness function, returning the best possible gain of a binary split. </p>
<p>Note that this takes O(n) time, where n is the number of points seen so far. So this may not exactly be fast...</p>
<p>The best possible split will be stored in bestFitness, and the second best possible split will be stored in secondBestFitness.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bestFitness</td><td>Fitness function value for best possible split. </td></tr>
<tr><td class="paramname">secondBestFitness</td><td>Fitness function value for second best possible split. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a37769243377056af37b41adfec46b8bd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::MajorityClass </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>The majority class of the points seen so far. </p>
<p>Referenced by <a class="el" href="binary__numeric__split_8hpp_source.html#l00093">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::NumChildren()</a>.</p>
</div>
</div>
<a class="anchor" id="a49c45c24bba4a46094664ac806701320"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname">double <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::MajorityProbability </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>The probability of the majority class given the points seen so far. </p>
<p>Referenced by <a class="el" href="binary__numeric__split_8hpp_source.html#l00093">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::NumChildren()</a>.</p>
</div>
</div>
<a class="anchor" id="ad812be693521007d13f9022f3dcc40fd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&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_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &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>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00093">93</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
<p>References <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a37769243377056af37b41adfec46b8bd">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::MajorityClass()</a>, <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a49c45c24bba4a46094664ac806701320">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::MajorityProbability()</a>, <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#ada680ee52b021bbfdd64d76c8943048c">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::Serialize()</a>, and <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#a3613e157797f9f591c99671211cea694">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::Split()</a>.</p>
</div>
</div>
<a class="anchor" id="ada680ee52b021bbfdd64d76c8943048c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&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_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &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 object. </p>
<p>Referenced by <a class="el" href="binary__numeric__split_8hpp_source.html#l00093">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::NumChildren()</a>.</p>
</div>
</div>
<a class="anchor" id="a3613e157797f9f591c99671211cea694"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::Split </td>
<td>(</td>
<td class="paramtype">arma::Col&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>childMajorities</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html#aee2d439f8cca76ded95b74c5afa26cfb">SplitInfo</a> &amp;&#160;</td>
<td class="paramname"><em>splitInfo</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Given that a split should happen, return the majority classes of the (two) children and an initialized SplitInfo object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">childMajorities</td><td>Majority classes of the children after the split. </td></tr>
<tr><td class="paramname">splitInfo</td><td>Split information. </td></tr>
</table>
</dd>
</dl>
<p>Referenced by <a class="el" href="binary__numeric__split_8hpp_source.html#l00093">mlpack::tree::BinaryNumericSplit&lt; FitnessFunction, ObservationType &gt;::NumChildren()</a>.</p>
</div>
</div>
<a class="anchor" id="abeaea8895e56f89904f83793e434fbb3"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::Train </td>
<td>(</td>
<td class="paramtype">ObservationType&#160;</td>
<td class="paramname"><em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>label</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Train on the given value with the given label. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">value</td><td>The value to train on. </td></tr>
<tr><td class="paramname">label</td><td>The label to train on. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a45b02598ef3670b154fdf1ff82189f2f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ObservationType <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::bestSplit</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>A cached best split point. </p>
<p>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00120">120</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="afa7a1cca0466ba96e7f8e12f50b0d721"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">arma::Col&lt;size_t&gt; <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::classCounts</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 classes we have seen so far (for majority calculations). </p>
<p>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00117">117</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae930b1c38e4dd56cdc012b2b64da4877"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::isAccurate</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>If true, the cached best split point is accurate (that is, we have not seen any more samples since we calculated it). </p>
<p>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00123">123</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a327b0e3094b57b69401e7ca27321ed72"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FitnessFunction , typename ObservationType = double&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::multimap&lt;ObservationType, size_t&gt; <a class="el" href="classmlpack_1_1tree_1_1BinaryNumericSplit.html">mlpack::tree::BinaryNumericSplit</a>&lt; FitnessFunction, ObservationType &gt;::sortedElements</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 elements seen so far, in sorted order. </p>
<p>Definition at line <a class="el" href="binary__numeric__split_8hpp_source.html#l00115">115</a> of file <a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.hpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/mlpack/methods/hoeffding_trees/<a class="el" href="binary__numeric__split_8hpp_source.html">binary_numeric_split.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>