Changeset 7301:5bdd0ca4dbaf in orange


Ignore:
Timestamp:
02/03/11 11:24:32 (3 years ago)
Author:
lanz <lan.zagar@…>
Branch:
default
Convert:
8d2d262ce46cc903b6e0835149179e87a44e914b
Message:

renamed classifierByLookupTable.py -> lookup-classifier.py
modified importing of code examples in classification/majority.py and classification/lookup.py

Location:
orange
Files:
1 added
1 deleted
2 edited

Legend:

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

    r7293 r7301  
    1919whether e is 1 (don't bother about the details, they follow later). 
    2020 
    21 part of `classifierByLookupTable.py`_ (uses: `monks-1.tab`_):: 
    22  
    23     import Orange 
    24      
    25     data = Orange.data.Table("monks-1") 
    26      
    27     a, b, e = data.domain["a"], data.domain["b"], data.domain["e"] 
    28      
    29     ab = Orange.data.feature.Discrete("a==b", values = ["no", "yes"]) 
    30     ab.getValueFrom = Orange.classification.lookup.ClassifierByLookupTable(ab, a, b, 
    31                         ["yes", "no", "no",  "no", "yes", "no",  "no", "no", "yes"]) 
    32      
    33     e1 = Orange.data.feature.Discrete("e==1", values = ["no", "yes"]) 
    34     e1.getValueFrom = Orange.classification.lookup.ClassifierByLookupTable(e1, e, 
    35                         ["yes", "no", "no", "no", "?"]) 
    36      
    37     data2 = data.select([a, b, ab, e, e1, data.domain.classVar]) 
     21part of `lookup-classifier.py`_ (uses: `monks-1.tab`_): 
     22 
     23.. literalinclude:: code/lookup-classifier.py 
     24    :lines: 7-21 
    3825     
    3926We can check the correctness of the script by printing out several 
     
    124111 
    125112 
    126 .. _classifierByLookupTable.py: code/classifierByLookupTable.py 
     113.. _lookup-classifier.py: code/lookup-classifier.py 
    127114.. _monks-1.tab: code/monks-1.tab 
    128115 
  • orange/Orange/classification/majority.py

    r7293 r7301  
    6666 
    6767.. literalinclude:: code/majority.py 
     68    :lines: 7- 
    6869 
    6970.. _majority.py: code/majority.py 
Note: See TracChangeset for help on using the changeset viewer.