source: orange/docs/reference/rst/Orange.classification.rst @ 9820:0cf4ce4db7da

Revision 9820:0cf4ce4db7da, 2.6 KB checked in by anze <anze.staric@…>, 2 years ago (diff)

Improved documentation.

Line 
1.. automodule:: Orange.classification
2
3###################################
4Classification (``classification``)
5###################################
6
7To facilitate correct evaluation, all classifiers in Orange consist of two
8parts, a Learner and a Classifier. A learner is constructed with all
9parameters that will be used for learning. When a data table is passed to its
10__call__ method, a model is fitted to the data and return in a form of a
11Classifier, which is then used for predicting the dependent variable(s) of
12new instances.
13
14.. class:: Learner()
15
16    Base class for all orange learners.
17
18    .. method:: __call__(instances)
19
20        Fit a model and return it as an instance of :class:`Classifier`.
21
22        This method is abstract and needs to be implemented on each learner.
23
24.. class:: Classifier()
25
26    Base class for all orange classifiers.
27
28    .. attribute:: GetValue
29
30        Return value of the target class when performing prediction.
31
32    .. attribute:: GetProbabilities
33
34        Return probability of each target class when performing prediction.
35
36    .. attribute:: GetBoth
37
38        Return a tuple of target class value and probabilities for each class.
39
40
41    .. method:: __call__(instances, return_type)
42
43        Classify a new instance using this model.
44
45        This method is abstract and needs to be implemented on each classifier.
46
47        :param instance: data instance to be classified.
48        :type instance: :class:`~Orange.data.Instance`
49
50        :param return_type: what needs to be predicted
51        :type return_type: :obj:`GetBoth`,
52                           :obj:`GetValue`,
53                           :obj:`GetProbabilities`
54
55        :rtype: :class:`~Orange.data.Value`,
56              :class:`~Orange.statistics.distribution.Distribution` or a
57              tuple with both
58
59
60When developing new prediction models, one should extend :obj:`Learner` and
61:obj:`Classifier`\. Code that infers the model from the data should be placed
62in Learners's :obj:`~Learner.__call__` method. This method should
63return a :obj:`Classifier`. Classifiers' :obj:`~Classifier.__call__` method
64should  return the predicition; :class:`~Orange.data.Value`,
65:class:`~Orange.statistics.distribution.Distribution` or a tuple with both
66based on the value of the parameter :obj:`return_type`.
67
68Orange implements various classifiers that are described in detail on
69separate pages.
70
71.. toctree::
72   :maxdepth: 2
73
74   Orange.classification.bayes
75   Orange.classification.knn
76   Orange.classification.logreg
77   Orange.classification.lookup
78   Orange.classification.majority
79   Orange.classification.rules
80   Orange.classification.svm
81   Orange.classification.tree
82   Orange.classification.random   
Note: See TracBrowser for help on using the repository browser.