Changeset 7208:10fa512d8710 in orange


Ignore:
Timestamp:
02/02/11 17:42:02 (3 years ago)
Author:
lanz <lan.zagar@…>
Branch:
default
Convert:
427a313d99dc6772cf027d3ffab7b3212c455a48
Message:

classification/majority (lanz)

Location:
orange
Files:
3 added
2 edited

Legend:

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

    r7191 r7208  
    1 from orange import MajorityLearner 
     1""" 
     2 
     3.. index:: majority 
     4 
     5Accuracy of classifiers is often compared to the "default accuracy", 
     6that is, the accuracy of a classifier which classifies all examples to 
     7the majority class. To fit into the standard schema, even this 
     8algorithm is provided in form of the usual learner-classifier pair. 
     9Learning is done by :obj:`MajorityLearner` and the classifier it 
     10constructs is an instance of :obj:`ConstantClassifier`. 
     11 
     12======== 
     13Learning 
     14======== 
     15 
     16.. class:: Orange.classify.MajorityLearner 
     17 
     18    MajorityLearner will most often be used as is, without setting any 
     19    features. Nevertheless, it has two. 
     20 
     21    :param estimatorConstructor: An estimator constructor that can  
     22      be used for estimation of class probabilities. If left None, 
     23      probability of each class is estimated as the relative  
     24      frequency of examples belonging to this class. 
     25    :type estimatorConstructor: :class:`Orange.???` or None 
     26    :param aprioriDistribution: Apriori class distribution that is 
     27      passed to estimator constructor if one is given. 
     28    :type aprioriDistribution: :class:`Orange.???` or None 
     29 
     30 
     31============== 
     32Classification 
     33============== 
     34 
     35.. class:: Orange.classify.ConstantClassifier 
     36 
     37    ConstantClassifier always classifies to the same class and reports 
     38    same class probabilities. 
     39 
     40    :param defaultVal: Value that is returned by the classifier. 
     41    :type defaultVal: :class:`Orange.???` or None 
     42    :param defaultDistribution: Class probabilities returned by the 
     43      classifier. 
     44    :type defaultDistribution: :class:`Orange.???` or None 
     45 
     46The ConstantClassifier's constructor can be called without arguments, 
     47with value (for defaultVal), variable (for classVar). If the value is 
     48given and is of type orange.Value (alternatives are an integer index 
     49of a discrete value or a continuous value), its field variable is will 
     50either be used for initializing classVar if variable is not given as 
     51an argument, or checked against the variable argument, if it is given.  
     52 
     53======== 
     54Examples 
     55======== 
     56 
     57This "learning algorithm" will most often be used to establish 
     58whether some other learning algorithm is better than "nothing". 
     59Here's a simple example. 
     60 
     61`majority.py`_ (uses: `monks-1.tab`_): 
     62 
     63.. literalinclude:: code/majority.py 
     64 
     65.. _majority.py: code/majority.py 
     66.. _monks-1.tab: code/monks-1.tab 
     67 
     68""" 
     69 
     70from Orange.core import MajorityLearner 
     71from Orange.core import DefaultClassifier as ConstantClassifier 
  • orange/doc/Orange/rst/index.rst

    r7199 r7208  
    1313 
    1414   orange.cluster 
     15   orange.classification.majority 
    1516   orange.classification.svm 
    1617   orange.classification.tree 
Note: See TracChangeset for help on using the changeset viewer.