source: orange/orange/regression/mean.py @ 9669:165371b04b4a

Revision 9669:165371b04b4a, 1.1 KB checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved content of Orange dir to package dir

Line 
1"""
2
3****
4Mean
5****
6
7.. index:: regression; mean
8
9
10Accuracy of classifiers is often compared to the "default accuracy".
11For regression, that is the accuracy of a classifier which predicts for
12all instances the mean value of all observed class values in the
13training data. To fit into the standard schema, even this algorithm
14is provided in form of the usual learner-classifier pair.
15Learning is done by :obj:`MeanLearner` and the classifier it
16constructs is an instance of :obj:`ConstantClassifier`.
17
18This is the regression counterpart of the
19:obj:`Orange.classification.majority.MajorityLearner`, which can be
20used for classification problems.
21
22.. rubric:: Examples
23
24This "learning algorithm" will most often be used to establish
25whether some other learning algorithm is better than "nothing".
26Here's a simple example.
27
28:download:`mean-regression.py <code/mean-regression.py>` (uses: :download:`housing.tab <code/housing.tab>`):
29
30.. literalinclude:: code/mean-regression.py
31    :lines: 7-
32
33"""
34
35from Orange.core import MajorityLearner as MeanLearner
36from Orange.core import DefaultClassifier as ConstantClassifier
Note: See TracBrowser for help on using the repository browser.