source: orange/Orange/orng/orngTree.py @ 10649:0ad406d2d7d8

Revision 10649:0ad406d2d7d8, 2.0 KB checked in by anze <anze.staric@…>, 2 years ago (diff)

Removed dump method (duplicate for to_string).

Line 
1from Orange.classification.tree import *
2
3from Orange.classification.tree import _countNodes, _countLeaves,\
4    _TreeClassifier, _TreeDumper
5
6def countNodes(self):
7    """
8    DEPRECATED. Return the number of nodes of tree.
9    """
10    return _countNodes(self.tree if isinstance(self, _TreeClassifier) or \
11        isinstance(self, TreeClassifier) else self)
12
13def countLeaves(self):
14    """
15    DEPRECATED. Return the number of leaves in the tree.
16    """
17    return _countLeaves(self.tree if isinstance(self, _TreeClassifier) or \
18        isinstance(self, TreeClassifier) else self)
19
20def dump(self, leafStr = "", nodeStr = "", **argkw): 
21    """
22    DEPRECATED. Replaced by :obj:`TreeClassifier.dump`.
23    """
24    return _TreeDumper(leafStr, nodeStr, argkw.get("userFormats", []) + 
25        _TreeDumper.defaultStringFormats, argkw.get("minExamples", 0), 
26        argkw.get("maxDepth", 1e10), argkw.get("simpleFirst", True),
27        self).dumpTree()
28
29def dot(self, fileName, leafStr = "", nodeStr = "", leafShape="plaintext", nodeShape="plaintext", **argkw):
30    """
31    DEPRECATED. Replaced by :obj:`TreeClassifier.dump`.
32    """
33    fle = isinstance(fileName, basestring) and file(fileName, "wt") or fileName
34
35    _TreeDumper(leafStr, nodeStr, argkw.get("userFormats", []) + 
36        _TreeDumper.defaultStringFormats, argkw.get("minExamples", 0), 
37        argkw.get("maxDepth", 1e10), argkw.get("simpleFirst", True), self,
38        leafShape=leafShape, nodeShape=nodeShape, fle=fle).dotTree()
39
40dumpTree = dump
41""" DEPRECATED: Replaced by :obj:`TreeClassifier.to_string`. """
42
43def printTree(*a, **aa):
44    """
45    DEPRECATED Print out the tree (call :func:`dumpTree` with the same
46    arguments and print out the result).
47    """
48    print dumpTree(*a, **aa)
49
50printTxt = printTree
51""" DEPRECATED. Replaced by :obj:`TreeClassifier.to_string` """
52
53printDot = dot
54""" DEPRECATED. Replaced by :obj:`TreeClassifier.dot` """
55
56dotTree = printDot
57""" DEPRECATED. Replaced by :obj:`TreeClassifier.dot` """
58
59byWhom = by_whom
60insertStr = insert_str
61insertDot = insert_dot
62insertNum = insert_num
Note: See TracBrowser for help on using the repository browser.