Ignore:
Timestamp:
02/07/12 19:15:16 (2 years ago)
Author:
blaz <blaz.zupan@…>
Branch:
default
Message:

updates for discretization rst

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/feature/discretization.py

    r9900 r9943  
    127127  def __call__(self, example, resultType = orange.GetValue): 
    128128    return self.classifier(example, resultType) 
    129  
    130 class DiscretizeTable(object): 
    131     """Discretizes all continuous features of the data table. 
    132  
    133     :param data: data to discretize. 
    134     :type data: :class:`Orange.data.Table` 
    135  
    136     :param features: data features to discretize. None (default) to discretize all features. 
    137     :type features: list of :class:`Orange.data.variable.Variable` 
    138  
    139     :param method: feature discretization method. 
    140     :type method: :class:`Discretization` 
    141     """ 
    142     def __new__(cls, data=None, features=None, discretize_class=False, method=EqualFreq(n=3)): 
    143         if data is None: 
    144             self = object.__new__(cls) 
    145             return self 
    146         else: 
    147             self = cls(features=features, discretize_class=discretize_class, method=method) 
    148             return self(data) 
    149  
    150     def __init__(self, features=None, discretize_class=False, method=EqualFreq(n=3)): 
    151         self.features = features 
    152         self.discretize_class = discretize_class 
    153         self.method = method 
    154  
    155     def __call__(self, data): 
    156         pp = Preprocessor_discretize(attributes=self.features, discretizeClass=self.discretize_class) 
    157         pp.method = self.method 
    158         return pp(data) 
    159  
Note: See TracChangeset for help on using the changeset viewer.