source: orange/docs/reference/rst/code/tree2.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 520 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

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