Files
mlpack/doc/html/dettutorial.html
T

177 lines
27 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: Density Estimation Tree (DET) tutorial</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 class="current"><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><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>
<!-- 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><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Density Estimation Tree (DET) tutorial </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="intro_det_tut"></a>
Introduction</h1>
<p>DETs perform the unsupervised task of density estimation using decision trees. Using a trained density estimation tree (DET), the density at any particular point can be estimated very quickly (O(log n) time, where n is the number of points the tree is built on).</p>
<p>The details of this work is presented in the following paper: </p><div class="fragment"><div class="line">@inproceedings{ram2011density,</div><div class="line"> title={Density <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> trees},</div><div class="line"> author={Ram, P. and Gray, A.G.},</div><div class="line"> booktitle={Proceedings of the 17th ACM SIGKDD International Conference on</div><div class="line"> Knowledge Discovery and Data Mining},</div><div class="line"> pages={627--635},</div><div class="line"> year={2011},</div><div class="line"> organization={ACM}</div><div class="line">}</div></div><!-- fragment --><p><b>mlpack</b> provides:</p>
<ul>
<li>a <a class="el" href="dettutorial.html#cli_det_tut">simple command-line executable</a> to perform density estimation and related analyses using DETs</li>
<li>a <a class="el" href="dettutorial.html#dtree_det_tut">generic C++ class (DTree)</a> which provides various functionality for the DETs</li>
<li>a set of functions in the namespace <a class="el" href="dettutorial.html#dtutils_det_tut">mlpack::det</a> to perform cross-validation for the task of density estimation with DETs</li>
</ul>
<h1><a class="anchor" id="toc_det_tut"></a>
Table of Contents</h1>
<p>A list of all the sections this tutorial contains.</p>
<ul>
<li><a class="el" href="dettutorial.html#intro_det_tut">Introduction</a></li>
<li><a class="el" href="dettutorial.html#toc_det_tut">Table of Contents</a></li>
<li><a class="el" href="dettutorial.html#cli_det_tut">Command-Line mlpack_det</a><ul>
<li><a class="el" href="dettutorial.html#cli_ex1_de_tut">Plain-vanilla density estimation</a></li>
<li><a class="el" href="dettutorial.html#cli_ex2_de_test_tut">Estimation on a test set</a></li>
<li><a class="el" href="dettutorial.html#cli_ex4_de_vi_tut">Computing the variable importance</a></li>
<li><a class="el" href="dettutorial.html#cli_ex6_de_save">Saving trained DETs</a></li>
<li><a class="el" href="dettutorial.html#cli_ex7_de_load">Loading trained DETs</a></li>
</ul>
</li>
<li><a class="el" href="dettutorial.html#dtree_det_tut">The 'DTree' class</a><ul>
<li><a class="el" href="dettutorial.html#dtree_pub_func_det_tut">Public Functions</a></li>
</ul>
</li>
<li><a class="el" href="dettutorial.html#dtutils_det_tut">'namespace mlpack::det'</a><ul>
<li><a class="el" href="dettutorial.html#dtutils_util_funcs">Utility Functions</a></li>
</ul>
</li>
<li><a class="el" href="dettutorial.html#further_doc_det_tut">Further Documentation</a></li>
</ul>
<h1><a class="anchor" id="cli_det_tut"></a>
Command-Line mlpack_det</h1>
<p>The command line arguments of this program can be viewed using the <code>-h</code> option:</p>
<div class="fragment"><div class="line">$ mlpack_det -h</div><div class="line">Density Estimation With Density Estimation Trees</div><div class="line"></div><div class="line"> This program performs a number of functions related to Density Estimation</div><div class="line"> Trees. The optimal Density Estimation Tree (DET) can be trained on a <a class="code" href="CMakeLists_8txt.html#ab6569987a823d6809800616d34cb649c">set</a> of</div><div class="line"> data (specified by --training_file or -t) using cross-validation (with number</div><div class="line"> of folds specified by --folds). This trained density <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> tree may then</div><div class="line"> be saved to a model <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> with the --output_model_file (-M) option.</div><div class="line"></div><div class="line"> The variable importances of each dimension may be saved with the --vi_file</div><div class="line"> (-i) option, and the density estimates on each training point may be saved to</div><div class="line"> the <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> specified with the --training_set_estimates_file (-e) option.</div><div class="line"></div><div class="line"> This program also can provide density estimates for a <a class="code" href="CMakeLists_8txt.html#ab6569987a823d6809800616d34cb649c">set</a> of test points,</div><div class="line"> specified in the --test_file (-T) <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a>. The density <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> tree used for</div><div class="line"> this task will be the tree that was trained on the given training points, or a</div><div class="line"> tree stored in the <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> given with the --input_model_file (-m) parameter. The</div><div class="line"> density estimates for the test points may be saved into the <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> specified</div><div class="line"> with the --test_set_estimates_file (-E) option.</div><div class="line"></div><div class="line"></div><div class="line">Options:</div><div class="line"></div><div class="line"> --folds (-f) [<span class="keywordtype">int</span>] The number of folds of cross-validation to</div><div class="line"> perform for the <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> (0 is LOOCV) Default</div><div class="line"> value 10.</div><div class="line"> --help (-h) Default help info.</div><div class="line"> --info [<span class="keywordtype">string</span>] Get help on a specific module or option.</div><div class="line"> Default value &#39;&#39;.</div><div class="line"> --input_model_file (-m) [<span class="keywordtype">string</span>]</div><div class="line"> File containing already trained density</div><div class="line"> <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> tree. Default value &#39;&#39;.</div><div class="line"> --max_leaf_size (-L) [<span class="keywordtype">int</span>] The maximum size of a leaf in the unpruned,</div><div class="line"> fully grown DET. Default value 10.</div><div class="line"> --min_leaf_size (-l) [<span class="keywordtype">int</span>] The minimum size of a leaf in the unpruned,</div><div class="line"> fully grown DET. Default value 5.</div><div class="line"> --output_model_file (-M) [<span class="keywordtype">string</span>]</div><div class="line"> File to save trained density <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> tree to.</div><div class="line"> Default value &#39;&#39;.</div><div class="line"> --test_file (-T) [<span class="keywordtype">string</span>] A <a class="code" href="CMakeLists_8txt.html#ab6569987a823d6809800616d34cb649c">set</a> of test points to estimate the density of.</div><div class="line"> Default value &#39;&#39;.</div><div class="line"> --test_set_estimates_file (-E) [<span class="keywordtype">string</span>]</div><div class="line"> The <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> in which to output the estimates on the</div><div class="line"> test <a class="code" href="CMakeLists_8txt.html#ab6569987a823d6809800616d34cb649c">set</a> from the final optimally pruned tree.</div><div class="line"> Default value &#39;&#39;.</div><div class="line"> --training_file (-t) [<span class="keywordtype">string</span>]</div><div class="line"> The data <a class="code" href="CMakeLists_8txt.html#ab6569987a823d6809800616d34cb649c">set</a> on which to build a density</div><div class="line"> <a class="code" href="det_8txt.html#a65306fe60b0233b3af272883cdc54a9d">estimation</a> tree. Default value &#39;&#39;.</div><div class="line"> --training_set_estimates_file (-e) [<span class="keywordtype">string</span>]</div><div class="line"> The <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> in which to output the density</div><div class="line"> estimates on the training <a class="code" href="CMakeLists_8txt.html#ab6569987a823d6809800616d34cb649c">set</a> from the final</div><div class="line"> optimally pruned tree. Default value &#39;&#39;.</div><div class="line"> --verbose (-v) Display informational messages and the full list</div><div class="line"> of parameters and timers at the end of</div><div class="line"> execution.</div><div class="line"> --version (-V) Display the version of <a class="code" href="namespacemlpack.html">mlpack</a>.</div><div class="line"> --vi_file (-i) [<span class="keywordtype">string</span>] The <a class="code" href="CMakeLists_8txt.html#adea3fe14b4bcd7b759ab67e9930e6e9c">file</a> to output the variable importance</div><div class="line"> values for each feature. Default value &#39;&#39;.</div><div class="line"></div><div class="line">For further information, including relevant papers, citations, and theory,</div><div class="line">consult the documentation found at <a class="code" href="bindings_2matlab_2CMakeLists_8txt.html#a3ad5384f46c4dc74d60b8f0322287b5a">http</a>:<span class="comment">//www.mlpack.org or included with your</span></div><div class="line">distribution of <a class="code" href="namespacemlpack.html">mlpack</a>.</div></div><!-- fragment --><h2><a class="anchor" id="cli_ex1_de_tut"></a>
Plain-vanilla density estimation</h2>
<p>We can just train a DET on the provided data set <em>S</em>. Like all datasets <b>mlpack</b> uses, the data should be row-major (<b>mlpack</b> transposes data when it is loaded; internally, the data is column-major &ndash; see <a class="el" href="matrices.html">this page</a> for more information).</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -v</div></div><!-- fragment --><p>By default, <code>mlpack_det</code> performs 10-fold cross-validation (using the <img class="formulaInl" alt="$\alpha$" src="form_114.png"/>-pruning regularization for decision trees). To perform LOOCV (leave-one-out cross-validation), which can provide better results but will take longer, use the following command:</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -f 0 -v</div></div><!-- fragment --><p>To perform k-fold crossvalidation, use <code>-f</code> <code>k</code> (or <code>&ndash;folds</code> <code>k</code>). There are certain other options available for training. For example, in the construction of the initial tree, you can specify the maximum and minimum leaf sizes. By default, they are 10 and 5 respectively; you can set them using the <code>-M</code> (<code>&ndash;max_leaf_size</code>) and the <code>-N</code> (<code>&ndash;min_leaf_size</code>) options.</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -M 20 -N 10</div></div><!-- fragment --><p>In case you want to output the density estimates at the points in the training set, use the <code>-e</code> (<code>&ndash;training_set_estimates_file</code>) option to specify the output file to which the estimates will be saved. The first line in density_estimates.txt will correspond to the density at the first point in the training set. Note that the logarithm of the density estimates are given, which allows smaller estimates to be saved.</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -e density_estimates.txt -v</div></div><!-- fragment --><h2><a class="anchor" id="cli_ex2_de_test_tut"></a>
Estimation on a test set</h2>
<p>Often, it is useful to train a density estimation tree on a training set and then obtain density estimates from the learned estimator for a separate set of test points. The <code>-T</code> (<code>&ndash;test_file</code>) option allows specification of a set of test points, and the <code>-E</code> (<code>&ndash;test_set_estimates_file</code>) option allows specification of the file into which the test set estimates are saved. Note that the logarithm of the density estimates are saved; this allows smaller values to be saved.</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -T test_points.csv -E test_density_estimates.txt -v</div></div><!-- fragment --><h2><a class="anchor" id="cli_ex4_de_vi_tut"></a>
Computing the variable importance</h2>
<p>The variable importance (with respect to density estimation) of the different features in the data set can be obtained by using the <code>-i</code> (<code>&ndash;vi_file</code> ) option. This outputs the absolute (as opposed to relative) variable importance of the all the features into the specified file.</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -i variable_importance.txt -v</div></div><!-- fragment --><h2><a class="anchor" id="cli_ex6_de_save"></a>
Saving trained DETs</h2>
<p>The <code>mlpack_det</code> program is capable of saving a trained DET to a file for later usage. The <code>&ndash;output_model_file</code> or <code>-M</code> option allows specification of the file to save to. In the example below, a DET trained on <code>dataset.csv</code> is saved to the file <code>det.xml</code>.</p>
<div class="fragment"><div class="line">$ mlpack_det -t dataset.csv -M det.xml -v</div></div><!-- fragment --><h2><a class="anchor" id="cli_ex7_de_load"></a>
Loading trained DETs</h2>
<p>A saved DET can be used to perform any of the functionality in the examples above. A saved DET is loaded with the <code>&ndash;input_model_file</code> or <code>-m</code> option. The example below loads a saved DET from <code>det.xml</code> and outputs density estimates on the dataset <code>test_dataset.csv</code> into the file <code>estimates.csv</code>.</p>
<div class="fragment"><div class="line">$ mlpack_det -m det.xml -T test_dataset.csv -E estimates.csv -v</div></div><!-- fragment --><h1><a class="anchor" id="dtree_det_tut"></a>
The 'DTree' class</h1>
<p>This class implements density estimation trees. Below is a simple example which initializes a density estimation tree.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="dtree_8hpp.html">mlpack/methods/det/dtree.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacemlpack_1_1det.html">mlpack::det</a>;</div><div class="line"></div><div class="line"><span class="comment">// The dataset matrix, on which to learn the density estimation tree.</span></div><div class="line"><span class="keyword">extern</span> arma::Mat&lt;float&gt; data;</div><div class="line"></div><div class="line"><span class="comment">// Initialize the tree. This function also creates and saves the bounding box</span></div><div class="line"><span class="comment">// of the data. Note that it does not actually build the tree.</span></div><div class="line"><a class="code" href="classmlpack_1_1det_1_1DTree.html">DTree&lt;&gt;</a> det(data);</div></div><!-- fragment --><h2><a class="anchor" id="dtree_pub_func_det_tut"></a>
Public Functions</h2>
<p>The function <code>Grow()</code> greedily grows the tree, adding new points to the tree. Note that the points in the dataset will be reordered. This should only be run on a tree which has not already been built. In general, it is more useful to use the <code><a class="el" href="namespacemlpack_1_1det.html#a87869f8ef3c28bc04f5cdb62bf415f17" title="Train the optimal decision tree using cross-validation with the given number of folds. ">Trainer()</a></code> function found in <a class="el" href="dettutorial.html#dtutils_det_tut">'namespace mlpack::det'</a>.</p>
<div class="fragment"><div class="line"><span class="comment">// This keeps track of the data during the shuffle that occurs while growing the</span></div><div class="line"><span class="comment">// tree.</span></div><div class="line">arma::Col&lt;size_t&gt; oldFromNew(data.n_cols);</div><div class="line"><span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; data.n_cols; i++)</div><div class="line"> oldFromNew[i] = i;</div><div class="line"></div><div class="line"><span class="comment">// This function grows the tree down to the leaves. It returns the current</span></div><div class="line"><span class="comment">// minimum value of the regularization parameter alpha.</span></div><div class="line"><span class="keywordtype">size_t</span> maxLeafSize = 10;</div><div class="line"><span class="keywordtype">size_t</span> minLeafSize = 5;</div><div class="line"></div><div class="line"><span class="keywordtype">double</span> <a class="code" href="det_8txt.html#ab91e75beea981a97844ff19e46d522e5">alpha</a> = det.Grow(data, oldFromNew, <span class="keyword">false</span>, maxLeafSize, minLeafSize);</div></div><!-- fragment --><p>Note that the alternate volume regularization should not be used (see ticket #238).</p>
<p>To estimate the density at a given query point, use the following code. Note that the logarithm of the density is returned.</p>
<div class="fragment"><div class="line"><span class="comment">// For a given query, you can obtain the density estimate.</span></div><div class="line"><span class="keyword">extern</span> arma::Col&lt;float&gt; query;</div><div class="line"><span class="keyword">extern</span> DTree* det;</div><div class="line"><span class="keywordtype">double</span> estimate = det-&gt;ComputeValue(&amp;query);</div></div><!-- fragment --><p>Computing the <b>variable</b> <b>importance</b> of each feature for the given DET.</p>
<div class="fragment"><div class="line"><span class="comment">// The data matrix and density estimation tree.</span></div><div class="line"><span class="keyword">extern</span> arma::mat data;</div><div class="line"><span class="keyword">extern</span> DTree* det;</div><div class="line"></div><div class="line"><span class="comment">// The variable importances will be saved into this vector.</span></div><div class="line">arma::Col&lt;double&gt; varImps;</div><div class="line"></div><div class="line"><span class="comment">// You can obtain the variable importance from the current tree.</span></div><div class="line">det-&gt;ComputeVariableImportance(varImps);</div></div><!-- fragment --><h1><a class="anchor" id="dtutils_det_tut"></a>
'namespace mlpack::det'</h1>
<p>The functions in this namespace allows the user to perform tasks with the 'DTree' class. Most importantly, the <code><a class="el" href="namespacemlpack_1_1det.html#a87869f8ef3c28bc04f5cdb62bf415f17" title="Train the optimal decision tree using cross-validation with the given number of folds. ">Trainer()</a></code> method allows the full training of a density estimation tree with cross-validation. There are also utility functions which allow printing of leaf membership and variable importance.</p>
<h2><a class="anchor" id="dtutils_util_funcs"></a>
Utility Functions</h2>
<p>The code below details how to train a density estimation tree with cross-validation.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="dt__utils_8hpp.html">mlpack/methods/det/dt_utils.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacemlpack_1_1det.html">mlpack::det</a>;</div><div class="line"></div><div class="line"><span class="comment">// The dataset matrix, on which to learn the density estimation tree.</span></div><div class="line"><span class="keyword">extern</span> arma::Mat&lt;float&gt; data;</div><div class="line"></div><div class="line"><span class="comment">// The number of folds for cross-validation.</span></div><div class="line"><span class="keyword">const</span> <span class="keywordtype">size_t</span> folds = 10; <span class="comment">// Set folds = 0 for LOOCV.</span></div><div class="line"></div><div class="line"><span class="keyword">const</span> <span class="keywordtype">size_t</span> maxLeafSize = 10;</div><div class="line"><span class="keyword">const</span> <span class="keywordtype">size_t</span> minLeafSize = 5;</div><div class="line"></div><div class="line"><span class="comment">// Train the density estimation tree with cross-validation.</span></div><div class="line"><a class="code" href="classmlpack_1_1det_1_1DTree.html">DTree&lt;&gt;</a>* dtree_opt = <a class="code" href="namespacemlpack_1_1det.html#a87869f8ef3c28bc04f5cdb62bf415f17">Trainer</a>(data, folds, <span class="keyword">false</span>, maxLeafSize, minLeafSize);</div></div><!-- fragment --><p>Note that the alternate volume regularization should be set to false because it has known bugs (see #238).</p>
<p>To print the class membership of leaves in the tree into a file, see the following code.</p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> arma::Mat&lt;size_t&gt; labels;</div><div class="line"><span class="keyword">extern</span> DTree* det;</div><div class="line"><span class="keyword">const</span> <span class="keywordtype">size_t</span> numClasses = 3; <span class="comment">// The number of classes must be known.</span></div><div class="line"></div><div class="line"><span class="keyword">extern</span> <span class="keywordtype">string</span> leafClassMembershipFile;</div><div class="line"></div><div class="line"><a class="code" href="namespacemlpack_1_1det.html#af87956fd1b9ecdbe6736a570e05f1df3">PrintLeafMembership</a>(det, data, labels, numClasses, leafClassMembershipFile);</div></div><!-- fragment --><p>Note that you can find the number of classes with <code>max(labels)</code> <code>+</code> <code>1</code>. The variable importance can also be printed to a file in a similar manner.</p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> DTree* det;</div><div class="line"></div><div class="line"><span class="keyword">extern</span> <span class="keywordtype">string</span> variableImportanceFile;</div><div class="line"><span class="keyword">const</span> <span class="keywordtype">size_t</span> numFeatures = data.n_rows;</div><div class="line"></div><div class="line"><a class="code" href="namespacemlpack_1_1det.html#ac64804c6c73b842b3eb69d9a64fb12e3">PrintVariableImportance</a>(det, numFeatures, variableImportanceFile);</div></div><!-- fragment --><h1><a class="anchor" id="further_doc_det_tut"></a>
Further Documentation</h1>
<p>For further documentation on the DTree class, consult the <a class="el" href="classmlpack_1_1det_1_1DTree.html">complete API documentation</a>. </p>
</div></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>