blob: 14b3599c6d7a82d56ef5706936267257fca3d199 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env python
#
# See also:
# http://www.ailab.si/orange/doc/ofb/c_otherclass.htm
import os.path
import sys
import orange
import orngTree
for arg in sys.argv[1:]:
name, ext = os.path.splitext(arg)
data = orange.ExampleTable(arg)
tree = orngTree.TreeLearner(data, sameMajorityPruning=1, mForPruning=2)
orngTree.printTxt(tree)
orngTree.printDot(tree, fileName=name+'.dot', nodeShape='ellipse', leafShape='box')
|