diff options
Diffstat (limited to 'src/gallium/state_trackers/python/tests/tree.py')
-rw-r--r-- | src/gallium/state_trackers/python/tests/tree.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/python/tests/tree.py b/src/gallium/state_trackers/python/tests/tree.py new file mode 100644 index 0000000000..14b3599c6d --- /dev/null +++ b/src/gallium/state_trackers/python/tests/tree.py @@ -0,0 +1,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') |