Ignore:
Timestamp:
02/29/12 20:11:56 (2 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Children:
10408:6f45065474c6, 10414:ac84efa944dc
Message:

Fixed a bug in classification.rules.rules_equal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/classification/rules.py

    r10379 r10407  
    13591359        for c2 in rule2.filter.conditions: 
    13601360            try: 
    1361                 if c1.position == c2.position and type(c1) == type(c2): 
    1362                     continue # same feature and type? 
    1363                 if isinstance(c1, Orange.data.filter.ValueFilterDiscrete): 
    1364                     if type(c1.values[0]) != type(c2.values[0]) or \ 
    1365                             c1.values[0] != c2.values[0]: 
    1366                         continue # same value? 
    1367                 if isinstance(c1, Orange.data.filter.ValueFilterContinuous): 
    1368                     if c1.oper != c2.oper or c1.ref != c2.ref: 
    1369                         continue # same operator? 
     1361                if not c1.position == c2.position: continue # same feature? 
     1362                if not type(c1) == type(c2): continue # same type of condition 
     1363                if type(c1) == Orange.core.ValueFilter_discrete: 
     1364                    if not type(c1.values[0]) == type(c2.values[0]): continue 
     1365                    if not c1.values[0] == c2.values[0]: continue # same value? 
     1366                if type(c1) == Orange.core.ValueFilter_continuous: 
     1367                    if not c1.oper == c2.oper: continue # same operator? 
     1368                    if not c1.ref == c2.ref: continue #same threshold? 
    13701369                found = True 
    13711370                break 
Note: See TracChangeset for help on using the changeset viewer.