source: orange/orange/doc/modules/orngC45.htm @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 1.9 KB checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

Line 
1<html><HEAD>
2<LINK REL=StyleSheet HREF="../style.css" TYPE="text/css">
3</HEAD>
4<body>
5<h1>orngC45: Printing out C45 Tree</h1>
6<index name="modules+c4.5">
7<index name="c45, printing out">
8
9<p>This module contains a single trivial function <code>printTree(tree)</code> which prints the tree given as an argument in the same form as Ross Quinlan's C4.5 program.</p>
10
11<xmp class="code">import orange, orngC45
12
13data = orange.ExampleTable("voting")
14c45 = orange.C45Learner(data)
15orngC45.printTree(c45)
16</xmp>
17will print out
18<xmp class="printout">physician-fee-freeze = n: democrat (253.4)
19physician-fee-freeze = y:
20|   synfuels-corporation-cutback = n: republican (145.7)
21|   synfuels-corporation-cutback = y:
22|   |   mx-missile = y: democrat (6.0)
23|   |   mx-missile = n:
24|   |   |   adoption-of-the-budget-resolution = n: republican (22.6)
25|   |   |   adoption-of-the-budget-resolution = y:
26|   |   |   |   anti-satellite-test-ban = n: democrat (5.0)
27|   |   |   |   anti-satellite-test-ban = y: republican (2.2)
28</xmp>
29
30<P>If you run the original C4.5 (that is, the standalone C4.5 - Orange does use the original C4.5) on the same data, it will print out
31<xmp class="printout">physician-fee-freeze = n: democrat (253.4/5.9)
32physician-fee-freeze = y:
33|   synfuels-corporation-cutback = n: republican (145.7/6.2)
34|   synfuels-corporation-cutback = y:
35|   |   mx-missile = y: democrat (6.0/2.4)
36|   |   mx-missile = n:
37|   |   |   adoption-of-the-budget-resolution = n: republican (22.6/5.2)
38|   |   |   adoption-of-the-budget-resolution = y:
39|   |   |   |   anti-satellite-test-ban = n: democrat (5.0/1.2)
40|   |   |   |   anti-satellite-test-ban = y: republican (2.2/1.0)</xmp>
41which is adoringly similar, except that C4.5 tested the tree on the learning data and has also printed out the number of errors in each node - something which <code>orngC45.printTree</code> obviously can't do (nor is there any need it should).</P>
42
43</body> </html>
Note: See TracBrowser for help on using the repository browser.