Ignore:
Timestamp:
02/25/12 22:34:49 (2 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Message:

Moved documentation for classification.majority to rst and polished it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/classification/majority.py

    r10191 r10368  
    1 """ 
    2 *********************** 
    3 Majority (``majority``) 
    4 *********************** 
    5  
    6 .. index:: majority classifier 
    7    pair: classification; majority classifier 
    8  
    9 Accuracy of classifiers is often compared to the "default accuracy", 
    10 that is, the accuracy of a classifier which classifies all instances 
    11 to the majority class. To fit into the standard schema, even this 
    12 algorithm is provided in form of the usual learner-classifier pair. 
    13 Learning is done by :obj:`MajorityLearner` and the classifier it 
    14 constructs is an instance of :obj:`ConstantClassifier`. 
    15  
    16 .. class:: MajorityLearner 
    17  
    18     MajorityLearner will most often be used as is, without setting any 
    19     parameters. Nevertheless, it has two. 
    20  
    21     .. attribute:: estimator_constructor 
    22      
    23         An estimator constructor that can be used for estimation of 
    24         class probabilities. If left None, probability of each class is 
    25         estimated as the relative frequency of instances belonging to 
    26         this class. 
    27          
    28     .. attribute:: apriori_distribution 
    29      
    30         Apriori class distribution that is passed to estimator 
    31         constructor if one is given. 
    32  
    33 .. class:: ConstantClassifier 
    34  
    35     ConstantClassifier always classifies to the same class and reports the 
    36     same class probabilities. 
    37  
    38     Its constructor can be called without arguments, with a variable (for 
    39     :obj:`class_var`), value (for :obj:`default_val`) or both. If the value 
    40     is given and is of type :obj:`Orange.data.Value` (alternatives are an 
    41     integer index of a discrete value or a continuous value), its attribute 
    42     :obj:`Orange.data.Value.variable` will either be used for initializing 
    43     :obj:`class_var` if variable is not given as an argument, or checked 
    44     against the variable argument, if it is given.  
    45      
    46     .. attribute:: default_val 
    47      
    48         Value that is returned by the classifier. 
    49      
    50     .. attribute:: default_distribution 
    51  
    52         Class probabilities returned by the classifier. 
    53      
    54     .. attribute:: class_var 
    55      
    56         Class variable that the classifier predicts. 
    57  
    58  
    59 Examples 
    60 ======== 
    61  
    62 This "learning algorithm" will most often be used as a baseline, 
    63 that is, to determine if some other learning algorithm provides 
    64 any information about the class (:download:`majority-classification.py <code/majority-classification.py>`): 
    65  
    66 .. literalinclude:: code/majority-classification.py 
    67     :lines: 7- 
    68  
    69 """ 
    70  
    711from Orange import core 
    722 
Note: See TracChangeset for help on using the changeset viewer.