⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtree.html

📁 it is tree Dtree algorithm. so see it. it is in c++
💻 HTML
📖 第 1 页 / 共 2 页
字号:
option, e.g. <tt>-p decision_tree_class</tt>.</p><p>If the table contains preclassified data and the name of the columncontaining the preclassification is the same as for the training data,the error rate of the decision tree is determined and printed to theterminal.</p><p>The contents of the file drug.cls should look like this:</p><pre>  Sex    Age Blood_pressure Drug dt  male   20  normal         A    A  female 73  normal         B    B  female 37  high           A    A  male   33  low            B    B  female 48  high           A    A  male   29  normal         A    A  female 52  normal         B    B  male   42  low            B    B  male   61  normal         B    B  female 30  normal         A    A  female 26  low            B    B  male   54  high           A    A</pre><p>That is, the classification is perfect, which is not surprisingfor such a simple example. The columns are neatly aligned because ofthe <tt>-a</tT> option. Without it, there would only be a singlespace between two column values.</p><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><h3><a name="xmat">Computing a Confusion Matrix</a></h3><p>The classification quality can be inspected in more detail withthe program <tt>xmat</tt> (determine a confusion matrix, to be foundin the table package, see below):</p><pre>  xmat drug.cls</pre><p>This program reads the output of the program <tt>dtx</tt> andcomputes a confusion matrix from two columns of this file. It usesthe last two columns by default (the last column for the x- and thesemi-last for the y-direction), which is fine for our example. Othercolumns can be selected via the options <tt>-x</tt> and <tt>-y</tt>followed by the name of the column that is to be used for the x- ory-direction of the confusion matrix. The output of the program<tt>xmat</tt>, which by default is written to the terminal, shouldread like this:</p><pre>  confusion matrix for Drug vs. dt:   no | value  |      1      2 | errors  ----+--------+---------------+-------    1 | A      |      6      0 |      0    2 | B      |      0      6 |      0  ----+--------+---------------+-------      | errors |      0      0 |      0</pre><p>In this matrix the x-direction corresponds to the column <tt>dt</tt>and the y-direction to the column <tt>Drug</tt>. Since in our simpleexample the classification is perfect, only the fields in the diagonaldiffer from zero. If the classification is not perfect, the otherfields show what errors are made by the decision tree classifier.</p><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><h3><a name="rules">Extracting Rules from a Decision Tree</a></h3><p>If you like rules better than trees, you can extract rules from alearned decision tree with the program <tt>dtr</tt> (<tt>dtr</tt> issimply an abbreviation for Decision Tree Rule Extraction).</p><pre>  dtr -sc drug.dt drug.rs</pre><p><tt>drug.dt</tt> is the decision tree file, <tt>drug.rs</tt> thefile to which the rules shall be written. The option <tt>-s</tt>instructs the program to print the support of each rule, i.e., thenumber of cases in the training data set the rule applies to, andthe option <tt>-c</tt> instructs it to print the confidence of eachrule, i.e., the percentage of cases in which a rule is correctrelative to the number of cases in which it is applicable. The file<tt>drug.rs</tt> should contain the following set of rules:</p><pre>  Drug = A <- Blood_pressure = high [3/100.0%];  Drug = B <- Blood_pressure = low [3/100.0%];  Drug = A <- Age < 41 & Blood_pressure = normal [3/100.0%];  Drug = B <- Age > 41 & Blood_pressure = normal [3/100.0%];</pre><p>The numbers in brackets are the number of cases in the trainingdata set the rule applies to (first number) and the confidence(second number). Note that there is one rule for each leaf of thedecision tree. The program tries to simplify the rules by combiningconditions on numeric attributes if possible, but it will notsimplify the rule set by merging rules.</p><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><h3><a name="other">Other Decision Tree Examples</a></h3><p>The decision trees in the directory <tt>dtree/ex</tt> (files withextensions <tt>.dt</tt> and <tt>.pdt</tt>) were created with thefollowing commands:</p><pre>  dti -a drug.dom drug.tab drug.dt  dti iris.dom iris.tab iris.dt  dti -s monk1.dom monk1.tab monk1.dt  dtp monk1.dt monk1.pdt monk1.tab  dti vote.dom vote.tab vote.dt  dtp vote.dt vote.pdt  dti wine.dom wine.tab wine.dt</pre><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><h3><a name="copying">Copying</a></h3><p>dti/dtp/dtx/dtr/rsx -   induce, prune, and execute decision and regression trees<br>   copyright &copy; 1996-2003 Christian Borgelt</p><p>These programs are free software; you can redistribute themand/or modify them under the terms of the<a href="http://www.fsf.org/copyleft/lesser.html">GNU Lesser (Library) General Public License</a> as published by the<a href="http://www.fsf.org">Free Software Foundation</a>.</p><p>These programs are distributed in the hope that they will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<a href="http://www.fsf.org/copyleft/lesser.html">GNU Lesser (Library) General Public License</a> for more details.</p><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><h3><a name="download">Download</a></h3><p><a href="http://fuzzy.cs.uni-magdeburg.de/~borgelt/dtree.html">Download page</a> with most recent version.</p><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><h3><a name="contact">Contact</a></h3><table border=0 cellpadding=0 cellspacing=0><tr><td valign=top>Snail mail:</td><td width=10></td>    <td><a href="http://fuzzy.cs.uni-magdeburg.de/~borgelt/index.html">        Christian Borgelt</a><br>        <a href="http://fuzzy.cs.uni-magdeburg.de/index.html">        Working Group Neural Networks and Fuzzy Systems</a><br>        <a href="http://www-iws.cs.uni-magdeburg.de/iws.html">         Department of Knowledge Processing and Language Engineering</a><br>        <a href="http://www.cs.uni-magdeburg.de/">        School of Computer Science</a><br>        <a href="http://www.uni-magdeburg.de/">        Otto-von-Guericke-University of Magdeburg</a><br>        Universit&auml;tsplatz 2<br>        D-39106 Magdeburg<br>        Germany</td></tr><tr><td valign=top>E-mail:</td><td></td>    <td><a href="mailto:christian.borgelt@cs.uni-magdeburg.de">        christian.borgelt@cs.uni-magdeburg.de</a><br>        <a href="mailto:borgelt@iws.cs.uni-magdeburg.de">        borgelt@iws.cs.uni-magdeburg.de</a></td></tr><tr><td>Phone:</td><td></td>    <td>+49 391 67 12700</td></tr><tr><td>Fax:</td><td></td>    <td>+49 391 67 12018</td></tr><tr><td>Office:</td><td></td>    <td>29.015</td></tr></table><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><td width="95%" align=right><a href="#top">back to the top</a></td>    <td width=5></td>    <td><a href="#top"><img src="uparrow.gif" border=0></a></td></tr></table><!-- =============================================================== --><p><img src="line.gif" alt="" height=7 width=704></p><address>&copy; 1999-2003<a href="mailto:borgelt@iws.cs.uni-magdeburg.de">Christian Borgelt</a></address><!-- Created: Thu May 24 12:28:05 CEST 2001 --><!-- hhmts start -->Last modified: Sat Apr 26 16:40:45 PDT 2003<!-- hhmts end --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -