Changeset 8986:2ae8c21d0be6 in orange


Ignore:
Timestamp:
09/20/11 11:37:22 (3 years ago)
Author:
markotoplak
Branch:
default
Convert:
30ff7b9bb6a495041c81803fa278bc4e5ea7dd2c
Message:

Orange.classification.tree updates.

Location:
orange
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/classification/tree.py

    r8904 r8986  
    12711271The function can use several utility function provided in the module. 
    12721272 
    1273 .. autofunction:: insertStr 
    1274  
    1275 .. autofunction:: insertDot 
    1276  
    1277 .. autofunction:: insertNum 
    1278  
    1279 .. autofunction:: byWhom 
     1273.. autofunction:: insert_str 
     1274 
     1275.. autofunction:: insert_dot 
     1276 
     1277.. autofunction:: insert_num 
     1278 
     1279.. autofunction:: by_whom 
    12801280 
    12811281 
     
    12951295 
    12961296    def replaceV(strg, mo, node, parent, tree): 
    1297         return insertStr(strg, mo, str(node.node_classifier.default_value)) 
     1297        return insert_str(strg, mo, str(node.node_classifier.default_value)) 
    12981298 
    12991299It therefore takes the value predicted at the node 
    13001300(:samp:`node.node_classifier.default_value` ), converts it to a string 
    1301 and passes it to *insertStr* to do the replacement. 
     1301and passes it to *insert_str* to do the replacement. 
    13021302 
    13031303A more complex regular expression is the one for the proportion of 
     
    13141314   :lines: 7-31 
    13151315 
    1316 We first defined getMargin which gets the distribution and computes 
    1317 the margin. The callback replaces, replaceB, computes the margin for 
    1318 the node.  If we need to divided the quantity by something (that is, 
    1319 if the :data:`by` group is present), we call :func:`byWhom` to get the 
    1320 node with whose margin this node's margin is to be divided. If this node 
    1321 (usually the parent) does not exist of if its margin is zero, we call 
    1322 :func:`insertDot` to insert a dot, otherwise we call :func:`insertNum` 
    1323 which will insert the number, obeying the format specified by the 
    1324 user. myFormat is a list containing the regular expression and the 
    1325 callback function. 
     1316``get_margin`` gets the distribution and computes the margin. The callback 
     1317replaces, ``replaceB``, computes the margin for the node.  If :data:`by` 
     1318group is present, we call :func:`by_whom` to get the node with whose 
     1319margin this node's margin is to be divided. If this node (usually the 
     1320parent) does not exist of if its margin is zero, :func:`insert_dot` 
     1321inserts dot, otherwise :func:`insert_num` is called which insert the 
     1322number in the user-specified format.  ``my_format`` contains the regular 
     1323expression and the callback function. 
    13261324 
    13271325We can now print out the iris tree: 
     
    13831381========================= 
    13841382 
    1385 We haven't been able to obtain the legal rights to distribute 
    1386 C4.5 and therefore couldn't statically link it into Orange. Instead, 
    1387 it's incorporated as a plug-in which you'll need to build yourself. 
    1388 The procedure is trivial, but you'll need a C compiler. On Windows, 
    1389 the scripts we provide work with MS Visual C and the files CL.EXE 
    1390 and LINK.EXE must be on the PATH. On Linux you're equipped with 
    1391 gcc. Mac OS X comes without gcc, but you can download it for 
    1392 free from Apple. 
    1393  
    1394 Orange must be installed prior to building C4.5. (This is because 
    1395 the build script will copy the created file next to Orange, 
    1396 which it obviously can't if Orange isn't there yet.) 
    1397  
    1398 #. Download the  
     1383C4.5 is not distributed with Orange, but it can be incorporated as a 
     1384plug-in. A C compiler is need for the procedure: on Windows MS Visual C 
     1385(CL.EXE and LINK.EXE must be on the PATH), on Linux and OS X gcc (OS X 
     1386users can download it from Apple). 
     1387 
     1388Orange must be installed prior to building C4.5. 
     1389 
     1390#. Download  
    13991391   `C4.5 (Release 8) sources <http://www.rulequest.com/Personal/c4.5r8.tar.gz>`_ 
    14001392   from the `Rule Quest's site <http://www.rulequest.com/>`_ and extract 
    1401    them into some temporary directory. The files will be modified in the 
    1402    further process, so don't use your copy of Quinlan's sources that you 
    1403    need for another purpose. 
    1404 #. Download  
    1405    `buildC45.zip <http://orange.biolab.si/orange/download/buildC45.zip>`_  
    1406    and unzip its contents into the directory R8/Src of the Quinlan's  
    1407    stuff (it's the directory that contains, for instance, the file 
    1408    average.c). 
     1393   them. The files will be modified in the 
     1394   further process. 
     1395#. Download 
     1396   `buildC45.zip <http://orange.biolab.si/orange/download/buildC45.zip>`_ 
     1397   and unzip its contents into the directory R8/Src of the C4.5 sources 
     1398   (this directory contains, for instance, the file average.c). 
    14091399#. Run buildC45.py, which will build the plug-in and put it next to  
    14101400   orange.pyd (or orange.so on Linux/Mac). 
    1411 #. Run python, type :samp:`import Orange` and  
    1412    create create :samp:`Orange.classification.tree.C45Learner()`. 
    1413    If this fails, something went wrong; see the diagnostic messages from 
    1414    buildC45.py and read the below paragraph. 
    1415 #. Finally, you can remove the Quinlan's stuff, along with everything 
    1416    created by buildC45.py. 
    1417  
    1418 If the process fails, here's what buildC45.py really does: it creates 
    1419 .h files that wrap Quinlan's .i files and ensure that they are not 
    1420 included twice. It modifies C4.5 sources to include .h's instead of 
    1421 .i's. This step can hardly fail. Then follows the platform dependent 
    1422 step which compiles ensemble.c (which includes all the Quinlan's .c 
    1423 files it needs) into c45.dll or c45.so and puts it next to Orange. 
    1424 If this fails, but you do have a C compiler and linker, and you know 
    1425 how to use them, you can compile the ensemble.c into a dynamic 
    1426 library yourself. See the compile and link steps in buildC45.py, 
    1427 if it helps. Anyway, after doing this check that the built C4.5 
    1428 gives the same results as the original. 
     1401#. Run python, type :samp:`import Orange` and 
     1402   create :samp:`Orange.classification.tree.C45Learner()`. This should 
     1403   succeed. 
     1404#. Finally, you can remove C4.5 sources. 
     1405 
     1406The buildC45.py creates .h files that wrap Quinlan's .i files and 
     1407ensure that they are not included twice. It modifies C4.5 sources to 
     1408include .h's instead of .i's (this step can hardly fail). Then it compiles 
     1409ensemble.c into c45.dll or c45.so and puts it next to Orange. In the end 
     1410it checks if the built C4.5 gives the same results as the original. 
    14291411 
    14301412.. autoclass:: C45Learner 
     
    17351717class C45Classifier(Orange.classification.Classifier): 
    17361718    """ 
    1737     A faithful reimplementation of Quinlan's function from C4.5. The only 
    1738     difference (and the only reason it's been rewritten) is that it uses 
    1739     a tree composed of :class:`C45Node` instead of C4.5's 
    1740     original tree structure. 
     1719    A faithful reimplementation of Quinlan's function from C4.5, but 
     1720    uses a tree composed of :class:`C45Node` instead of C4.5's original 
     1721    tree structure. 
    17411722 
    17421723    .. attribute:: tree 
    17431724 
    1744         C4.5 tree stored as a tree of :obj:`C45Node`. 
     1725        C4.5 tree stored as :obj:`C45Node`. 
    17451726    """ 
    17461727 
     
    17791760    def dump(self):   
    17801761        """ 
    1781         Prints the tree given as an argument in the same form as Ross Quinlan's  
     1762        Print the tree in the same form as Ross Quinlan's  
    17821763        C4.5 program. 
    17831764 
     
    17901771            print c45.dump() 
    17911772 
    1792         will print out 
     1773        prints 
    17931774 
    17941775        :: 
     
    18061787 
    18071788 
    1808         If you run the original C4.5 (that is, the standalone C4.5 - Orange does use the original C4.5) on the same data, it will print out 
    1809  
    1810         :: 
     1789        The standalone C4.5 would, on the same data, print:: 
    18111790 
    18121791            physician-fee-freeze = n: democrat (253.4/5.9) 
     
    18211800            |   |   |   |   anti-satellite-test-ban = y: republican (2.2/1.0) 
    18221801 
    1823         which is adoringly similar, except that C4.5 tested the tree on  
    1824         the learning data and has also printed out the number of errors  
    1825         in each node - something which :obj:`c45_printTree` obviously can't do 
    1826         (nor is there any need it should). 
    1827  
     1802        4.5 also prints out the number of errors on learning data in 
     1803        each node. 
    18281804        """ 
    18291805        return  _c45_printTree0(self.tree, self.class_var, 0) 
     
    19671943        Measure for scoring of the attributes when deciding which of the 
    19681944        attributes will be used for splitting of the instances in a node. 
    1969         Can be either a :class:`Orange.feature.scoring.Measure` or one of 
    1970         "infoGain" (:class:`Orange.feature.scoring.InfoGain`),  
    1971         "gainRatio" (:class:`Orange.feature.scoring.GainRatio`),  
    1972         "gini" (:class:`Orange.feature.scoring.Gini`), 
    1973         "relief" (:class:`Orange.feature.scoring.Relief`), 
    1974         "retis" (:class:`Orange.feature.scoring.MSE`). Default: "gainRatio". 
     1945        A subclass of :class:`Orange.feature.scoring.Score` (perhaps 
     1946        :class:`~Orange.feature.scoring.InfoGain`,  
     1947        :class:`~Orange.feature.scoring.GainRatio`,  
     1948        :class:`~Orange.feature.scoring.Gini`, 
     1949        :class:`~Orange.feature.scoring.Relief`, or 
     1950        :class:`~Orange.feature.scoring.MSE`). Default: :class:`Orange.feature.scoring.GainRatio`. 
    19751951 
    19761952    .. attribute:: relief_m, relief_k 
     
    19881964    .. attribute:: contingency_computer 
    19891965     
    1990         By default, this slot is left empty and ordinary contingency 
    1991         matrices are computed for instances at each node. If need 
    1992         arises, one can change the way the matrices are computed, 
    1993         for example to change the treatment of unknown values. The 
    1994         computed matrices can be used by split constructor and by 
    1995         stopping criteria. 
     1966        Used to change the way the contingency matrices (used 
     1967        by :class:`SplitConstructor` and :class:`StopCriteria`) are 
     1968        computed, for example, to change the treatment of unknown values. 
     1969        By default ordinary contingency matrices are computed for 
     1970        instances at each node. 
    19961971 
    19971972    **Pruning** 
     
    20252000        Induction stops when the proportion of majority class in the 
    20262001        node exceeds the value set by this parameter (default: 1.0).  
    2027         To stop the induction as soon as the majority class reaches 70%, 
    2028         use :samp:`max_majority=0.7`, as in the following 
    2029         example. The numbers show the majority class  
    2030         proportion at each node. The script `tree2.py`_ induces and  
    2031         prints this tree. 
    2032  
    2033         FIXME 
    2034  
    2035         .. _tree2.py: code/tree2.py 
    2036  
    2037         :: 
    2038  
    2039             root: 0.333 
    2040             |    petal width<=0.800: 1.000 
    2041             |    petal width>0.800: 0.500 
    2042             |    |    petal width<=1.750: 0.907 
    2043             |    |    petal width>1.750: 0.978 
    2044     
     2002   
    20452003    .. attribute:: stop 
    20462004 
     
    23102268re_I = re.compile("%"+fs+"I"+intrvl) 
    23112269 
    2312 def insertStr(s, mo, sub): 
     2270def insert_str(s, mo, sub): 
    23132271    """ Replace the part of s which is covered by mo  
    23142272    with the string sub. """ 
    23152273    return s[:mo.start()] + sub + s[mo.end():] 
    23162274 
    2317  
    2318 def insertDot(s, mo): 
     2275def insert_dot(s, mo): 
    23192276    """ Replace the part of s which is covered by mo  
    23202277    with a dot.  You should use this when the  
     
    23252282    return s[:mo.start()] + "." + s[mo.end():] 
    23262283 
    2327 def insertNum(s, mo, n): 
     2284def insert_num(s, mo, n): 
    23282285    """ Replace the part of s matched by mo with the number n,  
    23292286    formatted as specified by the user, that is, it multiplies  
     
    23412298    return s[:mo.start()] + ("%%%sf" % fs % n) + s[mo.end():] 
    23422299 
    2343 def byWhom(by, parent, tree): 
    2344     """ If by equals bp, it returns parent, else it returns  
     2300def by_whom(by, parent, tree): 
     2301    """ If by equals bp, return parent, else return 
    23452302    :samp:`tree.tree`. This is used to find what to divide the quantity  
    23462303    with, when division is required. 
     
    23522309 
    23532310def replaceV(strg, mo, node, parent, tree): 
    2354     return insertStr(strg, mo, str(node.node_classifier.default_value)) 
     2311    return insert_str(strg, mo, str(node.node_classifier.default_value)) 
    23552312 
    23562313def replaceN(strg, mo, node, parent, tree): 
     
    23582315    N = node.distribution.abs 
    23592316    if by: 
    2360         whom = byWhom(by, parent, tree) 
     2317        whom = by_whom(by, parent, tree) 
    23612318        if whom and whom.distribution: 
    23622319            if whom.distribution.abs > 1e-30: 
    23632320                N /= whom.distribution.abs 
    23642321        else: 
    2365             return insertDot(strg, mo) 
    2366     return insertNum(strg, mo, N) 
     2322            return insert_dot(strg, mo) 
     2323    return insert_num(strg, mo, N) 
    23672324         
    23682325 
     
    23722329    N = node.distribution[maj] 
    23732330    if by: 
    2374         whom = byWhom(by, parent, tree) 
     2331        whom = by_whom(by, parent, tree) 
    23752332        if whom and whom.distribution: 
    23762333            if whom.distribution[maj] > 1e-30: 
    23772334                N /= whom.distribution[maj] 
    23782335        else: 
    2379             return insertDot(strg, mo) 
    2380     return insertNum(strg, mo, N) 
     2336            return insert_dot(strg, mo) 
     2337    return insert_num(strg, mo, N) 
    23812338         
    23822339 
     
    23922349                    N /= byN 
    23932350            else: 
    2394                 return insertDot(strg, mo) 
     2351                return insert_dot(strg, mo) 
    23952352    else: 
    23962353        N = 0. 
    2397     return insertNum(strg, mo, N) 
     2354    return insert_num(strg, mo, N) 
    23982355 
    23992356 
    24002357def replaceCdisc(strg, mo, node, parent, tree): 
    24012358    if tree.class_var.var_type != Orange.data.Type.Discrete: 
    2402         return insertDot(strg, mo) 
     2359        return insert_dot(strg, mo) 
    24032360     
    24042361    by, op, cls = mo.group("by", "op", "cls") 
     
    24072364        N = node.distribution.abs - N 
    24082365    if by: 
    2409         whom = byWhom(by, parent, tree) 
     2366        whom = by_whom(by, parent, tree) 
    24102367        if whom and whom.distribution: 
    24112368            if whom.distribution[cls] > 1e-30: 
    24122369                N /= whom.distribution[cls] 
    24132370        else: 
    2414             return insertDot(strg, mo) 
    2415     return insertNum(strg, mo, N) 
     2371            return insert_dot(strg, mo) 
     2372    return insert_num(strg, mo, N) 
    24162373 
    24172374     
    24182375def replacecdisc(strg, mo, node, parent, tree): 
    24192376    if tree.class_var.var_type != Orange.data.Type.Discrete: 
    2420         return insertDot(strg, mo) 
     2377        return insert_dot(strg, mo) 
    24212378     
    24222379    op, by, cls = mo.group("op", "by", "cls") 
     
    24272384            N = 1 - N 
    24282385    if by: 
    2429         whom = byWhom(by, parent, tree) 
     2386        whom = by_whom(by, parent, tree) 
    24302387        if whom and whom.distribution: 
    24312388            if whom.distribution[cls] > 1e-30: 
    24322389                N /= whom.distribution[cls] / whom.distribution.abs 
    24332390        else: 
    2434             return insertDot(strg, mo) 
    2435     return insertNum(strg, mo, N) 
     2391            return insert_dot(strg, mo) 
     2392    return insert_num(strg, mo, N) 
    24362393 
    24372394 
     
    24402397def replaceCcont(strg, mo, node, parent, tree): 
    24412398    if tree.class_var.var_type != Orange.data.Type.Continuous: 
    2442         return insertDot(strg, mo) 
     2399        return insert_dot(strg, mo) 
    24432400     
    24442401    by, op, num = mo.group("by", "op", "num") 
     
    24472404    N = sum([x[1] for x in node.distribution.items() if op(x[0], num)], 0.) 
    24482405    if by: 
    2449         whom = byWhom(by, parent, tree) 
     2406        whom = by_whom(by, parent, tree) 
    24502407        if whom and whom.distribution: 
    24512408            byN = sum([x[1] for x in whom.distribution.items() if op(x[0], num)], 0.) 
     
    24532410                N /= byN 
    24542411        else: 
    2455             return insertDot(strg, mo) 
    2456  
    2457     return insertNum(strg, mo, N) 
     2412            return insert_dot(strg, mo) 
     2413 
     2414    return insert_num(strg, mo, N) 
    24582415     
    24592416     
    24602417def replaceccont(strg, mo, node, parent, tree): 
    24612418    if tree.class_var.var_type != Orange.data.Type.Continuous: 
    2462         return insertDot(strg, mo) 
     2419        return insert_dot(strg, mo) 
    24632420     
    24642421    by, op, num = mo.group("by", "op", "num") 
     
    24692426        N /= node.distribution.abs 
    24702427    if by: 
    2471         whom = byWhom(by, parent, tree) 
     2428        whom = by_whom(by, parent, tree) 
    24722429        if whom and whom.distribution: 
    24732430            byN = sum([x[1] for x in whom.distribution.items() if op(x[0], num)], 0.) 
     
    24752432                N /= byN/whom.distribution.abs # abs > byN, so byN>1e-30 => abs>1e-30 
    24762433        else: 
    2477             return insertDot(strg, mo) 
    2478     return insertNum(strg, mo, N) 
     2434            return insert_dot(strg, mo) 
     2435    return insert_num(strg, mo, N) 
    24792436 
    24802437 
     
    24942451def replaceCconti(strg, mo, node, parent, tree): 
    24952452    if tree.class_var.var_type != Orange.data.Type.Continuous: 
    2496         return insertDot(strg, mo) 
     2453        return insert_dot(strg, mo) 
    24972454 
    24982455    by = mo.group("by") 
    24992456    N = sum([x[1] for x in extractInterval(mo, node.distribution)]) 
    25002457    if by: 
    2501         whom = byWhom(by, parent, tree) 
     2458        whom = by_whom(by, parent, tree) 
    25022459        if whom and whom.distribution: 
    25032460            byN = sum([x[1] for x in extractInterval(mo, whom.distribution)]) 
     
    25052462                N /= byN 
    25062463        else: 
    2507             return insertDot(strg, mo) 
     2464            return insert_dot(strg, mo) 
    25082465         
    2509     return insertNum(strg, mo, N) 
     2466    return insert_num(strg, mo, N) 
    25102467 
    25112468             
    25122469def replacecconti(strg, mo, node, parent, tree): 
    25132470    if tree.class_var.var_type != Orange.data.Type.Continuous: 
    2514         return insertDot(strg, mo) 
     2471        return insert_dot(strg, mo) 
    25152472 
    25162473    N = sum([x[1] for x in extractInterval(mo, node.distribution)]) 
     
    25212478    by = mo.group("by") 
    25222479    if by: 
    2523         whom = byWhom(by, parent, tree) 
     2480        whom = by_whom(by, parent, tree) 
    25242481        if whom and whom.distribution: 
    25252482            byN = sum([x[1] for x in extractInterval(mo, whom.distribution)]) 
     
    25272484                N /= byN/whom.distribution.abs 
    25282485        else: 
    2529             return insertDot(strg, mo) 
     2486            return insert_dot(strg, mo) 
    25302487         
    2531     return insertNum(strg, mo, N) 
     2488    return insert_num(strg, mo, N) 
    25322489 
    25332490     
    25342491def replaceD(strg, mo, node, parent, tree): 
    25352492    if tree.class_var.var_type != Orange.data.Type.Discrete: 
    2536         return insertDot(strg, mo) 
     2493        return insert_dot(strg, mo) 
    25372494 
    25382495    fs, by, m100 = mo.group("fs", "by", "m100") 
    25392496    dist = list(node.distribution) 
    25402497    if by: 
    2541         whom = byWhom(by, parent, tree) 
     2498        whom = by_whom(by, parent, tree) 
    25422499        if whom: 
    25432500            for i, d in enumerate(whom.distribution): 
     
    25452502                    dist[i] /= d 
    25462503        else: 
    2547             return insertDot(strg, mo) 
     2504            return insert_dot(strg, mo) 
    25482505    mul = m100 and 100 or 1 
    25492506    fs = fs or (m100 and ".0" or "5.3") 
    2550     return insertStr(strg, mo, "["+", ".join(["%%%sf" % fs % (N*mul) for N in dist])+"]") 
     2507    return insert_str(strg, mo, "["+", ".join(["%%%sf" % fs % (N*mul) for N in dist])+"]") 
    25512508 
    25522509 
    25532510def replaced(strg, mo, node, parent, tree): 
    25542511    if tree.class_var.var_type != Orange.data.Type.Discrete: 
    2555         return insertDot(strg, mo) 
     2512        return insert_dot(strg, mo) 
    25562513 
    25572514    fs, by, m100 = mo.group("fs", "by", "m100") 
     
    25612518        dist = [d/ab for d in dist] 
    25622519    if by: 
    2563         whom = byWhom(by, parent, tree) 
     2520        whom = by_whom(by, parent, tree) 
    25642521        if whom: 
    25652522            for i, d in enumerate(whom.distribution): 
     
    25672524                    dist[i] /= d/whom.distribution.abs # abs > d => d>1e-30 => abs>1e-30 
    25682525        else: 
    2569             return insertDot(strg, mo) 
     2526            return insert_dot(strg, mo) 
    25702527    mul = m100 and 100 or 1 
    25712528    fs = fs or (m100 and ".0" or "5.3") 
    2572     return insertStr(strg, mo, "["+", ".join(["%%%sf" % fs % (N*mul) for N in dist])+"]") 
     2529    return insert_str(strg, mo, "["+", ".join(["%%%sf" % fs % (N*mul) for N in dist])+"]") 
    25732530 
    25742531 
    25752532def replaceAE(strg, mo, node, parent, tree): 
    25762533    if tree.class_var.var_type != Orange.data.Type.Continuous: 
    2577         return insertDot(strg, mo) 
     2534        return insert_dot(strg, mo) 
    25782535 
    25792536    AorE, bysub, by = mo.group("AorE", "bysub", "by") 
     
    25842541        A = node.distribution.error() 
    25852542    if by: 
    2586         whom = byWhom("b"+by, parent, tree) 
     2543        whom = by_whom("b"+by, parent, tree) 
    25872544        if whom: 
    25882545            if AorE == "A": 
     
    25962553                A -= avg 
    25972554        else: 
    2598             return insertDot(strg, mo) 
    2599     return insertNum(strg, mo, A) 
     2555            return insert_dot(strg, mo) 
     2556    return insert_num(strg, mo, A) 
    26002557 
    26012558 
     
    26042561def replaceI(strg, mo, node, parent, tree): 
    26052562    if tree.class_var.var_type != Orange.data.Type.Continuous: 
    2606         return insertDot(strg, mo) 
     2563        return insert_dot(strg, mo) 
    26072564 
    26082565    fs = mo.group("fs") or "5.3" 
     
    26152572    av = node.distribution.average()     
    26162573    il = node.distribution.error() * Z[intrvl] 
    2617     return insertStr(strg, mo, "[%%%sf-%%%sf]" % (fs, fs) % ((av-il)*mul, (av+il)*mul)) 
     2574    return insert_str(strg, mo, "[%%%sf-%%%sf]" % (fs, fs) % ((av-il)*mul, (av+il)*mul)) 
    26182575 
    26192576 
  • orange/doc/Orange/rst/code/orngTree2.py

    r8148 r8986  
    1717    by = mo.group("by") 
    1818    if margin and by: 
    19         whom = Orange.classification.tree.byWhom(by, parent, tree) 
     19        whom = Orange.classification.tree.by_whom(by, parent, tree) 
    2020        if whom and whom.distribution: 
    2121            div_margin = get_margin(whom.distribution) 
     
    2323                margin /= div_margin 
    2424            else: 
    25                 Orange.classification.tree.insertDot(strg, mo) 
     25                Orange.classification.tree.insert_dot(strg, mo) 
    2626        else: 
    27             return Orange.classification.tree.insertDot(strg, mo) 
    28     return Orange.classification.tree.insertNum(strg, mo, margin) 
     27            return Orange.classification.tree.insert_dot(strg, mo) 
     28    return Orange.classification.tree.insert_num(strg, mo, margin) 
    2929     
    3030my_format = [(re.compile("%"+Orange.classification.tree.fs 
  • orange/orngTree.py

    r8042 r8986  
    5757""" DEPRECATED. Replaced by :obj:`TreeClassifier.dot` """ 
    5858 
     59byWhom = by_whom 
     60insertStr = insert_str 
     61insertDot = insert_dot 
     62insertNum = insert_num 
Note: See TracChangeset for help on using the changeset viewer.