Changeset 9062:0091184aabed in orange


Ignore:
Timestamp:
10/05/11 15:05:09 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
d2bb51229d54f1b88a2989498c240d240aeb2c7f
Message:

Avoid full-name object/class reference in documentation of Orange.classification.rules. Closes #852.

File:
1 edited

Legend:

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

    r8741 r9062  
    2525Several variations of well-known CN2 rule learning algorithms are implemented. 
    2626All are implemented by wrapping the 
    27 :class:`Orange.classification.rules.RuleLearner` class. Each CN2 learner class 
     27:class:`~Orange.classification.rules.RuleLearner` class. Each CN2 learner class 
    2828in this module changes some of RuleLearner's replaceable components to reflect 
    2929the required behavior. 
     
    313313    
    314314      an object of class 
    315       :class:`Orange.classification.rules.RuleDataStoppingCriteria` 
     315      :class:`~Orange.classification.rules.RuleDataStoppingCriteria` 
    316316      that determines whether there will be any benefit from further learning 
    317317      (ie. if there is enough data to continue learning). The default 
    318318      implementation 
    319       (:class:`Orange.classification.rules.RuleDataStoppingCriteria_NoPositives`) 
     319      (:class:`~Orange.classification.rules.RuleDataStoppingCriteria_NoPositives`) 
    320320      returns True if there are no more instances of given class.  
    321321    
     
    323323       
    324324      an object of class  
    325       :class:`Orange.classification.rules.RuleStoppingCriteria` 
     325      :class:`~Orange.classification.rules.RuleStoppingCriteria` 
    326326      that decides from the last rule learned if it is worthwhile to use the 
    327327      rule and learn more rules. By default, no rule stopping criteria is 
     
    331331        
    332332      an object of class 
    333       :class:`Orange.classification.rules.RuleCovererAndRemover` 
     333      :class:`~Orange.classification.rules.RuleCovererAndRemover` 
    334334      that removes instances covered by the rule and returns remaining 
    335335      instances. The default implementation 
    336       (:class:`Orange.classification.rules.RuleCovererAndRemover_Default`) 
     336      (:class:`~Orange.classification.rules.RuleCovererAndRemover_Default`) 
    337337      only removes the instances that belong to given target class, except if 
    338338      it is not given (ie. target_class==-1). 
     
    341341       
    342342      an object of class 
    343       :class:`Orange.classification.rules.RuleFinder` that learns a single 
     343      :class:`~Orange.classification.rules.RuleFinder` that learns a single 
    344344      rule from instances. Default implementation is 
    345       :class:`Orange.classification.rules.RuleBeamFinder`. 
     345      :class:`~Orange.classification.rules.RuleBeamFinder`. 
    346346 
    347347   Constructor can be given the following parameters: 
     
    357357       constrain the learning space. If not set, it will be set to a set 
    358358       containing only an empty rule. 
    359    :type base_rules: :class:`Orange.classification.rules.RuleList` 
     359   :type base_rules: :class:`~Orange.classification.rules.RuleList` 
    360360 
    361361Rule finders 
     
    386386          constrain the learning space. If not set, it will be set to a set 
    387387          containing only an empty rule. 
    388       :type base_rules: :class:`Orange.classification.rules.RuleList` 
     388      :type base_rules: :class:`~Orange.classification.rules.RuleList` 
    389389 
    390390.. class:: Orange.classification.rules.RuleBeamFinder 
    391391    
    392    Bases: :class:`Orange.classification.rules.RuleFinder` 
     392   Bases: :class:`~Orange.classification.rules.RuleFinder` 
    393393    
    394394   Beam search for the best rule. This is the default class used in RuleLearner 
     
    422422    
    423423      an object of class 
    424       :class:`Orange.classification.rules.RuleBeamInitializer` 
     424      :class:`~Orange.classification.rules.RuleBeamInitializer` 
    425425      used to initialize rules_star and for selecting the 
    426426      initial best rule. By default 
    427       (:class:`Orange.classification.rules.RuleBeamInitializer_Default`), 
     427      (:class:`~Orange.classification.rules.RuleBeamInitializer_Default`), 
    428428      base_rules are returned as starting rulesSet and the best from base_rules 
    429429      is set as best_rule. If base_rules are not set, this class will return 
     
    434434    
    435435      an object of class 
    436       :class:`Orange.classification.rules.RuleBeamCandidateSelector` 
     436      :class:`~Orange.classification.rules.RuleBeamCandidateSelector` 
    437437      used to separate a subset from the current 
    438438      rules_star and return it. These rules will be used in the next 
    439439      specification step. Default component (an instance of 
    440       :class:`Orange.classification.rules.RuleBeamCandidateSelector_TakeAll`) 
     440      :class:`~Orange.classification.rules.RuleBeamCandidateSelector_TakeAll`) 
    441441      takes all rules in rules_star 
    442442     
     
    444444    
    445445      an object of class 
    446       :class:`Orange.classification.rules.RuleBeamRefiner` 
     446      :class:`~Orange.classification.rules.RuleBeamRefiner` 
    447447      used to refine given rule. New rule should cover a 
    448448      strict subset of examples covered by given rule. Default component 
    449       (:class:`Orange.classification.rules.RuleBeamRefiner_Selector`) adds 
     449      (:class:`~Orange.classification.rules.RuleBeamRefiner_Selector`) adds 
    450450      a conjunctive selector to selectors present in the rule. 
    451451     
     
    453453    
    454454      an object of class 
    455       :class:`Orange.classification.rules.RuleBeamFilter` 
     455      :class:`~Orange.classification.rules.RuleBeamFilter` 
    456456      used to filter rules to keep beam relatively small 
    457457      to contain search complexity. By default, it takes five best rules: 
    458       :class:`Orange.classification.rules.RuleBeamFilter_Width`\ *(m=5)*\ . 
     458      :class:`~Orange.classification.rules.RuleBeamFilter_Width`\ *(m=5)*\ . 
    459459 
    460460   .. method:: __call__(data, weight_id, target_class, base_rules) 
     
    472472    
    473473   :param base_rules: existing rules. 
    474    :type base_rules: :class:`Orange.classification.rules.RuleList` 
     474   :type base_rules: :class:`~Orange.classification.rules.RuleList` 
    475475 
    476476Rule evaluators 
     
    488488       
    489489      :param rule: rule to evaluate. 
    490       :type rule: :class:`Orange.classification.rules.Rule` 
     490      :type rule: :class:`~Orange.classification.rules.Rule` 
    491491       
    492492      :param instances: a table of instances, covered by the rule. 
     
    514514.. class:: Orange.classification.rules.RuleEvaluator_Entropy 
    515515 
    516    Bases: :class:`Orange.classification.rules.RuleEvaluator` 
     516   Bases: :class:`~Orange.classification.rules.RuleEvaluator` 
    517517     
    518518.. class:: Orange.classification.rules.RuleEvaluator_LRS 
    519519 
    520    Bases: :class:`Orange.classification.rules.RuleEvaluator` 
     520   Bases: :class:`~Orange.classification.rules.RuleEvaluator` 
    521521 
    522522.. class:: Orange.classification.rules.RuleEvaluator_Laplace 
    523523 
    524    Bases: :class:`Orange.classification.rules.RuleEvaluator` 
     524   Bases: :class:`~Orange.classification.rules.RuleEvaluator` 
    525525 
    526526.. class:: Orange.classification.rules.RuleEvaluator_mEVC 
    527527 
    528    Bases: :class:`Orange.classification.rules.RuleEvaluator` 
     528   Bases: :class:`~Orange.classification.rules.RuleEvaluator` 
    529529    
    530530Instance covering and removal 
     
    541541       
    542542      :param rule: rule to evaluate. 
    543       :type rule: :class:`Orange.classification.rules.Rule` 
     543      :type rule: :class:`~Orange.classification.rules.Rule` 
    544544       
    545545      :param instances: a table of instances, covered by the rule. 
     
    707707    :param evaluator: an object that evaluates a rule from covered instances. 
    708708        By default, entropy is used as a measure.  
    709     :type evaluator: :class:`Orange.classification.rules.RuleEvaluator` 
     709    :type evaluator: :class:`~Orange.classification.rules.RuleEvaluator` 
    710710    :param beam_width: width of the search beam. 
    711711    :type beam_width: int 
     
    756756    Classical CN2 (see Clark and Niblett; 1988) classifies a new instance 
    757757    using an ordered set of rules. Usually the learner 
    758     (:class:`Orange.classification.rules.CN2Learner`) is used to construct the 
     758    (:class:`~Orange.classification.rules.CN2Learner`) is used to construct the 
    759759    classifier. 
    760760     
     
    763763     
    764764    :param rules: learned rules to be used for classification (mandatory). 
    765     :type rules: :class:`Orange.classification.rules.RuleList` 
     765    :type rules: :class:`~Orange.classification.rules.RuleList` 
    766766     
    767767    :param instances: data instances that were used for learning. 
     
    840840    :param evaluator: an object that evaluates a rule from covered instances. 
    841841        By default, Laplace's rule of succession is used as a measure.  
    842     :type evaluator: :class:`Orange.classification.rules.RuleEvaluator` 
     842    :type evaluator: :class:`~Orange.classification.rules.RuleEvaluator` 
    843843    :param beam_width: width of the search beam. 
    844844    :type beam_width: int 
     
    909909    CN2 unordered (see Clark and Boswell; 1991) classifies a new instance using 
    910910    a set of unordered rules. Usually the learner 
    911     (:class:`Orange.classification.rules.CN2UnorderedLearner`) is used to 
     911    (:class:`~Orange.classification.rules.CN2UnorderedLearner`) is used to 
    912912    construct the classifier. 
    913913     
     
    916916     
    917917    :param rules: learned rules to be used for classification (mandatory). 
    918     :type rules: :class:`Orange.classification.rules.RuleList` 
     918    :type rules: :class:`~Orange.classification.rules.RuleList` 
    919919     
    920920    :param instances: data instances that were used for learning. 
     
    999999    """ 
    10001000    CN2-SD (see Lavrac et al.; 2004) induces a set of unordered rules, which 
    1001     is the same as :class:`Orange.classification.rules.CN2UnorderedLearner`. 
     1001    is the same as :class:`~Orange.classification.rules.CN2UnorderedLearner`. 
    10021002    The difference between classical CN2 unordered and CN2-SD is selection of 
    10031003    specific evaluation function and covering function: 
     
    10151015    :param evaluator: an object that evaluates a rule from covered instances. 
    10161016        By default, weighted relative accuracy is used. 
    1017     :type evaluator: :class:`Orange.classification.rules.RuleEvaluator` 
     1017    :type evaluator: :class:`~Orange.classification.rules.RuleEvaluator` 
    10181018    :param beam_width: width of the search beam. 
    10191019    :type beam_width: int 
     
    15451545    CN2-SD (see Lavrac et al.; 2004) induces a set of unordered rules in a 
    15461546    simmilar manner as 
    1547     :class:`Orange.classification.rules.CN2SDUnorderedLearner`. This 
     1547    :class:`~Orange.classification.rules.CN2SDUnorderedLearner`. This 
    15481548    implementation uses the EVC rule evaluation. 
    15491549     
     
    15551555    :param evaluator: an object that evaluates a rule from covered instances. 
    15561556        By default, weighted relative accuracy is used. 
    1557     :type evaluator: :class:`Orange.classification.rules.RuleEvaluator` 
     1557    :type evaluator: :class:`~Orange.classification.rules.RuleEvaluator` 
    15581558    :param beam_width: width of the search beam. 
    15591559    :type beam_width: int 
     
    18561856     
    18571857    :param rule: rule to pretty-print. 
    1858     :type rule: :class:`Orange.classification.rules.Rule` 
     1858    :type rule: :class:`~Orange.classification.rules.Rule` 
    18591859     
    18601860    :param show_distribution: determines whether presentation should also 
Note: See TracChangeset for help on using the changeset viewer.