Changeset 7383:61c4f42b3b10 in orange


Ignore:
Timestamp:
02/04/11 09:21:52 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
fa822a0ed28e63d45ed5111ffa6ce37a054dabac
Message:

Finished documentation of rules module: additional pseudocode formatting.

File:
1 edited

Legend:

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

    r7380 r7383  
    220220    
    221221   The class' functionality can be best explained by showing its __call__ 
    222    function:: 
    223     
    224         def __call__(self, instances, weightID=0): 
    225             ruleList = Orange.classification.rules.RuleList() 
    226             allInstances = Orange.data.Table(instances) 
    227             while not self.dataStopping(instances, weightID, self.targetClass): 
    228                 newRule = self.ruleFinder(instances, weightID, self.targetClass, 
    229                                           self.baseRules) 
    230                 if self.ruleStopping(ruleList, newRule, instances, weightID): 
    231                     break 
    232                 instances, weightID = self.coverAndRemove(newRule, instances, 
    233                                                         weightID, self.targetClass) 
    234                 ruleList.append(newRule) 
    235             return Orange.classification.rules..RuleClassifier_FirstRule( 
    236                 rules=ruleList, instances=allInstances) 
     222   function: 
     223    
     224   .. parsed-literal:: 
     225 
     226      def \_\_call\_\_(self, instances, weightID=0): 
     227          ruleList = Orange.classification.rules.RuleList() 
     228          allInstances = Orange.data.Table(instances) 
     229          while not self.\ **dataStopping**\ (instances, weightID, self.targetClass): 
     230              newRule = self.\ **ruleFinder**\ (instances, weightID, self.targetClass, 
     231                                        self.baseRules) 
     232              if self.\ **ruleStopping**\ (ruleList, newRule, instances, weightID): 
     233                  break 
     234              instances, weightID = self.\ **coverAndRemove**\ (newRule, instances, 
     235                                                      weightID, self.targetClass) 
     236              ruleList.append(newRule) 
     237          return Orange.classification.rules.RuleClassifier_FirstRule( 
     238              rules=ruleList, instances=allInstances) 
    237239                 
    238240   The four customizable components here are the invoked dataStopping, 
Note: See TracChangeset for help on using the changeset viewer.