Files
mlpack/doc/html/dt__utils_8hpp_source.html
T

120 lines
14 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: src/mlpack/methods/det/dt_utils.hpp Source File</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><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><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="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_44a936ef30fc126706c6284a2fc0c990.html">mlpack</a></li><li class="navelem"><a class="el" href="dir_3cfbf900288ec2fe8dd2c2c8482f216e.html">methods</a></li><li class="navelem"><a class="el" href="dir_829fd86abfc32d55a3f25eeda79942f5.html">det</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">dt_utils.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="dt__utils_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="preprocessor">#ifndef MLPACK_METHODS_DET_DT_UTILS_HPP</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#define MLPACK_METHODS_DET_DT_UTILS_HPP</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="prereqs_8hpp.html">mlpack/prereqs.hpp</a>&gt;</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="dtree_8hpp.html">dtree.hpp</a>&quot;</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacemlpack.html">mlpack</a> {</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="namespacemlpack_1_1det.html"> 20</a></span>&#160;<span class="keyword">namespace </span>det {</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> MatType, <span class="keyword">typename</span> TagType&gt;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacemlpack_1_1det.html#af87956fd1b9ecdbe6736a570e05f1df3">PrintLeafMembership</a>(<a class="code" href="classmlpack_1_1det_1_1DTree.html">DTree&lt;MatType, TagType&gt;</a>* dtree,</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">const</span> MatType&amp; data,</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">const</span> arma::Mat&lt;size_t&gt;&amp; labels,</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> numClasses,</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">const</span> <a class="code" href="bindings_2matlab_2CMakeLists_8txt.html#ad3a3f86b22ab94a882506e9e614165f1">std::string</a> leafClassMembershipFile = <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> MatType, <span class="keyword">typename</span> TagType&gt;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacemlpack_1_1det.html#ac64804c6c73b842b3eb69d9a64fb12e3">PrintVariableImportance</a>(<span class="keyword">const</span> <a class="code" href="classmlpack_1_1det_1_1DTree.html">DTree&lt;MatType, TagType&gt;</a>* dtree,</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keyword">const</span> <a class="code" href="bindings_2matlab_2CMakeLists_8txt.html#ad3a3f86b22ab94a882506e9e614165f1">std::string</a> viFile = <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> MatType, <span class="keyword">typename</span> TagType&gt;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<a class="code" href="classmlpack_1_1det_1_1DTree.html">DTree&lt;MatType, TagType&gt;</a>* <a class="code" href="namespacemlpack_1_1det.html#a87869f8ef3c28bc04f5cdb62bf415f17">Trainer</a>(MatType&amp; dataset,</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> folds,</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">const</span> <span class="keywordtype">bool</span> useVolumeReg = <span class="keyword">false</span>,</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> maxLeafSize = 10,</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> minLeafSize = 5,</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keyword">const</span> <a class="code" href="bindings_2matlab_2CMakeLists_8txt.html#ad3a3f86b22ab94a882506e9e614165f1">std::string</a> unprunedTreeOutput = <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;} <span class="comment">// namespace det</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;} <span class="comment">// namespace mlpack</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor">#include &quot;dt_utils_impl.hpp&quot;</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="preprocessor">#endif // MLPACK_METHODS_DET_DT_UTILS_HPP</span></div><div class="ttc" id="namespacemlpack_html"><div class="ttname"><a href="namespacemlpack.html">mlpack</a></div><div class="ttdoc">Linear algebra utility functions, generally performed on matrices or vectors. </div><div class="ttdef"><b>Definition:</b> <a href="binarize_8hpp_source.html#l00018">binarize.hpp:18</a></div></div>
<div class="ttc" id="prereqs_8hpp_html"><div class="ttname"><a href="prereqs_8hpp.html">prereqs.hpp</a></div><div class="ttdoc">The core includes that mlpack expects; standard C++ includes and Armadillo. </div></div>
<div class="ttc" id="namespacemlpack_1_1det_html_af87956fd1b9ecdbe6736a570e05f1df3"><div class="ttname"><a href="namespacemlpack_1_1det.html#af87956fd1b9ecdbe6736a570e05f1df3">mlpack::det::PrintLeafMembership</a></div><div class="ttdeci">void PrintLeafMembership(DTree&lt; MatType, TagType &gt; *dtree, const MatType &amp;data, const arma::Mat&lt; size_t &gt; &amp;labels, const size_t numClasses, const std::string leafClassMembershipFile=&quot;&quot;)</div><div class="ttdoc">Print the membership of leaves of a density estimation tree given the labels and number of classes...</div></div>
<div class="ttc" id="dtree_8hpp_html"><div class="ttname"><a href="dtree_8hpp.html">dtree.hpp</a></div></div>
<div class="ttc" id="classmlpack_1_1det_1_1DTree_html"><div class="ttname"><a href="classmlpack_1_1det_1_1DTree.html">mlpack::det::DTree</a></div><div class="ttdoc">A density estimation tree is similar to both a decision tree and a space partitioning tree (like a kd...</div><div class="ttdef"><b>Definition:</b> <a href="dtree_8hpp_source.html#l00046">dtree.hpp:46</a></div></div>
<div class="ttc" id="bindings_2matlab_2CMakeLists_8txt_html_ad3a3f86b22ab94a882506e9e614165f1"><div class="ttname"><a href="bindings_2matlab_2CMakeLists_8txt.html#ad3a3f86b22ab94a882506e9e614165f1">string</a></div><div class="ttdeci">test cpp RESULT_VARIABLE MEX_RESULT_TRASH OUTPUT_VARIABLE MEX_OUTPUT ERROR_VARIABLE MEX_ERROR_TRASH string(REGEX MATCH&quot;Warning: You are using&quot;MEX_WARNING&quot;${MEX_OUTPUT}&quot;) if(MEX_WARNING) string(REGEX REPLACE&quot;.*using [a-zA-Z]* version \&quot;([0-9.]*)[^\&quot;]*\&quot;.*&quot;&quot;\\1&quot;OTHER_COMPILER_VERSION&quot;$</div><div class="ttdef"><b>Definition:</b> <a href="bindings_2matlab_2CMakeLists_8txt_source.html#l00018">CMakeLists.txt:18</a></div></div>
<div class="ttc" id="namespacemlpack_1_1det_html_ac64804c6c73b842b3eb69d9a64fb12e3"><div class="ttname"><a href="namespacemlpack_1_1det.html#ac64804c6c73b842b3eb69d9a64fb12e3">mlpack::det::PrintVariableImportance</a></div><div class="ttdeci">void PrintVariableImportance(const DTree&lt; MatType, TagType &gt; *dtree, const std::string viFile=&quot;&quot;)</div><div class="ttdoc">Print the variable importance of each dimension of a density estimation tree. </div></div>
<div class="ttc" id="namespacemlpack_1_1det_html_a87869f8ef3c28bc04f5cdb62bf415f17"><div class="ttname"><a href="namespacemlpack_1_1det.html#a87869f8ef3c28bc04f5cdb62bf415f17">mlpack::det::Trainer</a></div><div class="ttdeci">DTree&lt; MatType, TagType &gt; * Trainer(MatType &amp;dataset, const size_t folds, const bool useVolumeReg=false, const size_t maxLeafSize=10, const size_t minLeafSize=5, const std::string unprunedTreeOutput=&quot;&quot;)</div><div class="ttdoc">Train the optimal decision tree using cross-validation with the given number of folds. </div></div>
</div><!-- fragment --></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>