source: orange/orange/doc/Orange/rst/code/tree2.py @ 7713:d27afc892c9c

Revision 7713:d27afc892c9c, 504 bytes checked in by markotoplak, 3 years ago (diff)

Tree documentation update.

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
9data = Orange.data.Table("iris.tab")
10
11print "BIG TREE:"
12tree1 = Orange.classification.tree.TreeLearner(data)
13print tree1.dump(leafStr="%m", nodeStr=".")
14
15print "\nPRE-PRUNED TREE:"
16tree2 = Orange.classification.tree.TreeLearner(data, maxMajority=0.7)
17print tree2.dump(leafStr="%m", nodeStr=".")
Note: See TracBrowser for help on using the repository browser.