Ignore:
Timestamp:
01/09/12 20:56:36 (2 years ago)
Author:
markotoplak
Branch:
default
Convert:
738752a0c7d4b09064ca82da7eb74891fde3fa34
Message:

Used the same get_meta_id everywhere.

File:
1 edited

Legend:

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

    r9349 r9525  
    13061306        (newDomain, targetVal) = createDichotomousClass(examples.domain, examples.domain.class_var, str(cl), negate=0) 
    13071307        newDomainmetas = newDomain.getmetas() 
    1308         newDomain.addmeta(Orange.core.newmetaid(), examples.domain.class_var) # old class as meta 
     1308        newDomain.addmeta(Orange.data.new_meta_id(), examples.domain.class_var) # old class as meta 
    13091309        dichData = examples.select(newDomain) 
    13101310        if self.argument_id: 
     
    17021702    def __call__(self, rule, instances, weights, target_class): 
    17031703        if not weights: 
    1704             weights = Orange.core.newmetaid() 
     1704            weights = Orange.data.new_meta_id() 
    17051705            instances.addMetaAttribute(weights,1.) 
    17061706            instances.domain.addmeta(weights, Orange.data.variable.\ 
    17071707                Continuous("weights-"+str(weights)), True) 
    1708         newWeightsID = Orange.core.newmetaid() 
     1708        newWeightsID = Orange.data.new_meta_id() 
    17091709        instances.addMetaAttribute(newWeightsID,1.) 
    17101710        instances.domain.addmeta(newWeightsID, Orange.data.variable.\ 
     
    17271727    def __call__(self, rule, instances, weights, target_class): 
    17281728        if not weights: 
    1729             weights = Orange.core.newmetaid() 
     1729            weights = Orange.data.new_meta_id() 
    17301730            instances.addMetaAttribute(weights,1.) 
    17311731            instances.domain.addmeta(weights, Orange.data.variable.\ 
     
    17351735        except: 
    17361736            coverage = Orange.data.variable.Continuous("Coverage") 
    1737             instances.domain.addmeta(Orange.core.newmetaid(),coverage, True) 
     1737            instances.domain.addmeta(Orange.data.new_meta_id(),coverage, True) 
    17381738            instances.addMetaAttribute(coverage,0.0) 
    1739         newWeightsID = Orange.core.newmetaid() 
     1739        newWeightsID = Orange.data.new_meta_id() 
    17401740        instances.addMetaAttribute(newWeightsID,1.) 
    17411741        instances.domain.addmeta(newWeightsID, Orange.data.variable.\ 
     
    17581758    def __init__(self, examples, weight_id, target_class, apriori, argument_id): 
    17591759        self.best_rule = [None]*len(examples) 
    1760         self.prob_attribute = Orange.core.newmetaid() 
     1760        self.prob_attribute = Orange.data.new_meta_id() 
    17611761        self.apriori_prob = apriori[target_class]/apriori.abs 
    17621762        examples.addMetaAttribute(self.prob_attribute, self.apriori_prob) 
Note: See TracChangeset for help on using the changeset viewer.