Ignore:
Timestamp:
03/02/12 17:28:26 (2 years ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
rebase_source:
efb2d43049d190652cdba30ec071ee651410bedc
Message:

Minor code clean-up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/multitarget/tree.py

    r10335 r10432  
    8585        # Types of classes allowed 
    8686        self.handles_discrete = True 
    87         ### TODO: for discrete classes with >2 values entropy should be used instead of variance 
     87        ## TODO: for discrete classes with >2 values entropy should be used 
     88        ## instead of variance 
    8889        self.handles_continuous = True 
    8990        # Can handle continuous features 
     
    9596 
    9697 
    97     def threshold_function(self, feature, data, cont_distrib=None, weightID=0): 
     98    def threshold_function(self, feature, data, cont_distrib=None, weights=0): 
    9899        """ 
    99100        Evaluates possible splits of a continuous feature into a binary one 
     
    140141        return (threshold, score, None) 
    141142 
    142     def __call__(self, feature, data, apriori_class_distribution=None, weightID=0): 
     143    def __call__(self, feature, data, apriori_class_distribution=None, 
     144                 weights=0): 
    143145        """ 
    144146        :param feature: The feature to be scored. 
     
    154156        for ins in data: 
    155157            split[ins[feature].value].append(ins.get_classes()) 
    156         score = -sum(weighted_variance(x, self.weights) * len(x) for x in split.values()) 
     158        score = -sum(weighted_variance(x, self.weights) * len(x) 
     159                     for x in split.values()) 
    157160        return score 
    158161 
Note: See TracChangeset for help on using the changeset viewer.