source: orange/Orange/doc/modules/tree2.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 498 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Author:      J Zabkar
2# Version:     1.0
3# Description: Pre-prunning of classification tree using orngTree module
4# Category:    modelling
5# Uses:        iris.tab
6# Referenced:   orngTree.htm
7
8import orange, orngTree
9data = orange.ExampleTable("iris.tab")
10
11print "BIG TREE:"
12tree1 = orngTree.TreeLearner(data)
13orngTree.printTree(tree1, leafStr="%m", nodeStr=".")
14
15print "\nPRE-PRUNED TREE:"
16tree2 = orngTree.TreeLearner(data, maxMajority=0.7)
17orngTree.printTree(tree2, leafStr="%m", nodeStr=".")
Note: See TracBrowser for help on using the repository browser.