source: orange/docs/reference/rst/code/tree2.py @ 9567:73ff6ea797da

Revision 9567:73ff6ea797da, 520 bytes checked in by markotoplak, 2 years ago (diff)

Tree: format -> to_string.

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.to_string(leaf_str="%m", node_str=".")
14
15print "\nPRE-PRUNED TREE:"
16tree2 = Orange.classification.tree.TreeLearner(data, max_majority=0.7)
17print tree2.to_string(leaf_str="%m", node_str=".")
18
Note: See TracBrowser for help on using the repository browser.