Changeset 7376:4eaadcf98944 in orange


Ignore:
Timestamp:
02/04/11 01:22:51 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
791e18252c2d7a8a3e812db3c9b7f04c885aa7da
Message:

Finished documentation of rules module. This time for real.

File:
1 edited

Legend:

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

    r7366 r7376  
    112112    IF TRUE THEN survived=yes<0.000, 5.000> 
    113113 
    114 Notice that we first need to set the ruleFinder 
    115 component, because the default components are not constructed when the learner 
    116 is constructed, but only when we run it on data. At that time, the algorithm 
    117 checks which components are necessary and sets defaults. Similarly, when the 
    118 learner finishes, it destructs all default components. Continuing with our 
    119 example, assume that we wish to set a different validation function and a 
    120 different bean width. This is simply written as: 
     114Notice that we first need to set the ruleFinder component, because the default 
     115components are not constructed when the learner is constructed, but only when 
     116we run it on data. At that time, the algorithm checks which components are 
     117necessary and sets defaults. Similarly, when the learner finishes, it destructs 
     118all *default* components. Continuing with our example, assume that we wish to 
     119set a different validation function and a different bean width. This is simply 
     120written as: 
    121121 
    122122.. literalinclude:: code/rules-customized.py 
     
    140140       
    141141      each rule can be used as a classical Orange like 
    142       classifier. Must be of type :class:`Orange.classification.Classifier`. By default, 
    143       an instance of :class:`Orange.core.DefaultClassifier` is used. 
     142      classifier. Must be of type :class:`Orange.classification.Classifier`. 
     143      By default, an instance of :class:`Orange.core.DefaultClassifier` is used. 
    144144    
    145145   .. attribute:: learner 
     
    662662    classifier. 
    663663         
    664         :param instance: instance to be classifier 
    665         :type instance: :class:`Orange.data.Instance` 
    666         :param result_type: :class:`Orange.classification.Classifier.GetValue` or \ 
    667               :class:`Orange.classification.Classifier.GetProbabilities` or 
    668               :class:`Orange.classification.Classifier.GetBoth` 
    669          
    670         :rtype: :class:`Orange.data.Value`,  
    671               :class:`Orange.statistics.Distribution` or a tuple with both 
     664    :param instance: instance to be classifier 
     665    :type instance: :class:`Orange.data.Instance` 
     666     
     667    :param result_type: :class:`Orange.classification.Classifier.GetValue` or \ 
     668          :class:`Orange.classification.Classifier.GetProbabilities` or 
     669          :class:`Orange.classification.Classifier.GetBoth` 
     670     
     671    :rtype: :class:`Orange.data.Value`,  
     672          :class:`Orange.statistics.Distribution` or a tuple with both 
    672673     
    673674    """ 
     
    774775class CN2UnorderedClassifier(RuleClassifier): 
    775776    """ 
    776     CN2 unordered (see Clark and Boswell; 1991) induces a set of unordered 
    777     rules. Usually the learner 
     777    CN2 unordered (see Clark and Boswell; 1991) classifies a new instance using 
     778    a set of unordered rules. Usually the learner 
    778779    (:class:`Orange.classification.rules.CN2UnorderedLearner`) is used to 
    779780    construct the classifier. 
    780781         
    781         :param instance: instance to be classifier 
    782         :type instance: :class:`Orange.data.Instance` 
    783         :param result_type: :class:`Orange.classification.Classifier.GetValue` or \ 
    784               :class:`Orange.classification.Classifier.GetProbabilities` or 
    785               :class:`Orange.classification.Classifier.GetBoth` 
    786          
    787         :rtype: :class:`Orange.data.Value`,  
    788               :class:`Orange.statistics.Distribution` or a tuple with both 
     782    :param instance: instance to be classifier 
     783    :type instance: :class:`Orange.data.Instance` 
     784    :param result_type: :class:`Orange.classification.Classifier.GetValue` or \ 
     785          :class:`Orange.classification.Classifier.GetProbabilities` or 
     786          :class:`Orange.classification.Classifier.GetBoth` 
     787     
     788    :rtype: :class:`Orange.data.Value`,  
     789          :class:`Orange.statistics.Distribution` or a tuple with both 
    789790     
    790791    """ 
     
    900901class CN2EVCUnorderedLearner(ABCN2): 
    901902    """ 
    902     CN2 + EVC as evaluation + LRC classification. 
     903    CN2-SD (see Lavrac et al.; 2004) induces a set of unordered rules in a 
     904    simmilar manner as 
     905    :class:`Orange.classification.rules.CN2SDUnorderedLearner`. This 
     906    implementation uses the EVC rule evaluation. 
     907     
     908    If data instances are provided to the constructor, the learning algorithm 
     909    is called and the resulting classifier is returned instead of the learner. 
     910 
     911    Constructor can be given the following parameters: 
     912     
     913    :param evaluator: an object that evaluates a rule from covered instances. 
     914        By default, weighted relative accuracy is used. 
     915    :type evaluator: :class:`Orange.classification.rules.RuleEvaluator` 
     916    :param beamWidth: width of the search beam. 
     917    :type beamWidth: int 
     918    :param alpha: significance level of the statistical test to determine 
     919        whether rule is good enough to be returned by rulefinder. Likelihood 
     920        ratio statistics is used that gives an estimate if rule is 
     921        statistically better than the default rule. 
     922    :type alpha: float 
     923    :param mult: multiplicator for weights of covered instances. 
     924    :type mult: float 
    903925    """ 
    904926    def __init__(self, width=5, nsampling=100, rule_sig=1.0, att_sig=1.0, min_coverage = 1., max_rule_complexity = 5.): 
Note: See TracChangeset for help on using the changeset viewer.