Ignore:
Timestamp:
02/07/12 17:52:23 (2 years ago)
Author:
ales_erjavec
Branch:
default
rebase_source:
2cf5b388fbfb884f9033150cdd96858877e0f652
Message:

Changed Score_SVMWeights to ScoreSVMWeights

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/classification/svm/__init__.py

    r9923 r9933  
    7979.. autoclass:: Orange.classification.svm.RFE 
    8080 
    81 .. autoclass:: Orange.classification.svm.Score_SVMWeights 
     81.. autoclass:: Orange.classification.svm.ScoreSVMWeights 
    8282    :show-inheritance: 
    8383  
     
    253253                 coef0=0, shrinking=True, probability=True, verbose=False,  
    254254                 cache_size=200, eps=0.001, normalization=True, 
    255                  weight=[], **kwargs): 
     255                 weight=(), **kwargs): 
    256256        self.svm_type = svm_type 
    257257        self.kernel_type = kernel_type 
     
    684684exampleWeightedSum = example_weighted_sum 
    685685 
    686 class Score_SVMWeights(Orange.feature.scoring.Score): 
     686class ScoreSVMWeights(Orange.feature.scoring.Score): 
    687687    """Score feature by training a linear SVM classifier, using a squared sum of  
    688688    weights (of each binary classifier) as the returned score. 
     
    690690    Example: 
    691691     
    692         >>> score = Score_SVMWeights() 
     692        >>> score = ScoreSVMWeights() 
    693693        >>> for feature in table.domain.features: 
    694694            ...   print "%15s: %.3f" % (feature.name, score(feature, table)) 
     
    696696    """ 
    697697     
    698     def __new__(cls, attr=None, data=None, weightId=None, **kwargs): 
     698    def __new__(cls, attr=None, data=None, weight_id=None, **kwargs): 
    699699        self = Orange.feature.scoring.Score.__new__(cls, **kwargs) 
    700700        if data is not None and attr is not None: 
    701701            self.__init__(**kwargs) 
    702             return self.__call__(attr, data, weightId) 
     702            return self.__call__(attr, data, weight_id) 
    703703        else: 
    704704            return self 
    705705         
    706706    def __reduce__(self): 
    707         return Score_SVMWeights, (), dict(self.__dict__) 
     707        return ScoreSVMWeights, (), dict(self.__dict__) 
    708708     
    709709    def __init__(self, learner=None, **kwargs): 
     
    722722        self._cached_examples = None 
    723723         
    724     def __call__(self, attr, data, weightId=None): 
     724    def __call__(self, attr, data, weight_id=None): 
    725725        if data is self._cached_examples: 
    726726            weights = self._cached_weights 
    727727        else: 
    728             classifier = self.learner(data, weightId) 
     728            classifier = self.learner(data, weight_id) 
    729729            self._cached_examples = data 
    730730            import numpy 
     
    735735        return weights.get(attr, 0.0) 
    736736 
    737 MeasureAttribute_SVMWeights = Score_SVMWeights 
     737MeasureAttribute_SVMWeights = ScoreSVMWeights 
    738738 
    739739class RFE(object): 
Note: See TracChangeset for help on using the changeset viewer.