Changeset 7380:665423ddd0a2 in orange


Ignore:
Timestamp:
02/04/11 01:30:08 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
01430a0dff36b7ee4705127bc6da07f491e40219
Message:

rules.py: Revert attribute name instances->examples to unbreak the widgets.

File:
1 edited

Legend:

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

    r7376 r7380  
    675675    def __init__(self, rules=None, instances=None, weightID = 0, **argkw): 
    676676        self.rules = rules 
    677         self.instances = instances 
     677        self.examples = instances 
    678678        self.weightID = weightID 
    679679        self.classVar = None if instances is None else instances.domain.classVar 
     
    792792    def __init__(self, rules = None, instances = None, weightID = 0, **argkw): 
    793793        self.rules = rules 
    794         self.instances = instances 
     794        self.examples = instances 
    795795        self.weightID = weightID 
    796796        self.classVar = instances.domain.classVar if instances is not None else None 
     
    809809 
    810810        # create empty distribution 
    811         retDist = Orange.core.DiscDistribution(self.instances.domain.classVar) 
     811        retDist = Orange.core.DiscDistribution(self.examples.domain.classVar) 
    812812        covRules = RuleList() 
    813813        # iterate through instances - add distributions 
     
    822822             
    823823        if sumdisc > 0.0: 
    824             for c in self.instances.domain.classVar: 
     824            for c in self.examples.domain.classVar: 
    825825                retDist[c] /= sumdisc 
    826826        else: 
     
    983983    def __init__(self, rules, instances, weightID = 0, **argkw): 
    984984        self.rules = rules 
    985         self.instances = instances 
     985        self.examples = instances 
    986986        self.classVar = instances.domain.classVar 
    987987        self.__dict__.update(argkw) 
     
    10021002        sumdist = sum(retDist) 
    10031003        if sumdist > 0.0: 
    1004             for c in self.instances.domain.classVar: 
     1004            for c in self.examples.domain.classVar: 
    10051005                retDist[c] /= sumdisc 
    10061006        else: 
Note: See TracChangeset for help on using the changeset viewer.