Changeset 9553:be024c77a0df in orange


Ignore:
Timestamp:
01/19/12 16:04:12 (2 years ago)
Author:
lanz <lan.zagar@…>
Branch:
default
Convert:
b09bcb3103ce8d49f2f6618727d3f4b5e9615cd5
Message:

Added some documentation for Orange.multitarget

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.data.domain.rst

    r9535 r9553  
    7878 
    7979 
     80.. _multiple-classes: 
     81 
    8082Multiple classes 
    8183================ 
     
    8385A domain can have multiple additional class attributes. These are stored 
    8486similarly to other features except that they are not used for learning. The 
    85 list of such classes is stored in `class_vars`. When converting between 
    86 domains, multiple classes can become ordinary features or the class, and 
    87 vice versa. 
     87list of such classes is stored in :obj:`~Orange.data.Domain.class_vars`. 
     88When converting between domains, multiple classes can become ordinary 
     89features or the class, and vice versa. 
    8890 
    8991.. _meta-attributes: 
  • docs/reference/rst/Orange.multitarget.rst

    r9534 r9553  
    33########################################### 
    44 
    5 .. automodule:: Orange.multitarget 
     5This module contains methods for working with 
     6:ref:`multi-target data <multiple-classes>`. 
    67 
    78.. toctree:: 
     
    910 
    1011   Orange.multitarget.tree 
     12   Orange.regression.pls 
     13 
     14 
     15.. automodule:: Orange.multitarget 
  • orange/Orange/multitarget/__init__.py

    r9550 r9553  
     1""" 
     2Wrapper for constructing multi-target learners 
     3============================================== 
     4 
     5This module also contains a wrapper, an auxilary learner, that can be used 
     6to construct simple multi-target learners from standard learners designed 
     7for data with a single class. The wrapper uses the specified base learner 
     8to construct independent models for each class. 
     9 
     10.. index:: MultitargetLearner 
     11.. autoclass:: Orange.multitarget.MultitargetLearner 
     12    :members: 
     13    :show-inheritance: 
     14 
     15.. index:: MultitargetClassifier 
     16.. autoclass:: Orange.multitarget.MultitargetClassifier 
     17    :members: 
     18    :show-inheritance: 
     19 
     20Examples 
     21======== 
     22 
     23The following example demonstrates how to build a prediction model for 
     24multi-target data and use it to predict (multiple) class values for 
     25a new instance (:download:`multitarget.py <code/multitarget.py>`, 
     26uses :download:`test-pls.tab <code/test-pls.tab>`): 
     27 
     28.. literalinclude:: code/multitarget.py 
     29 
     30""" 
     31 
    132import Orange 
    233 
     
    2657     
    2758    def __init__(self, learner, **kwargs): 
     59        """ 
     60        :param learner: Base learner used to construct independent\ 
     61            models for each class. 
     62        """ 
     63 
    2864        self.learner = learner 
    2965        self.__dict__.update(kwargs) 
    3066 
    3167    def __call__(self, data, weight=0): 
    32         """Learn independent models of the base learner for each class. 
     68        """ 
     69        Learn independent models of the base learner for each class. 
    3370 
    3471        :param data: Multitarget data instances (with more than 1 class). 
    35         :type data: Orange.data.Table 
     72        :type data: :class:`Orange.data.Table` 
     73 
    3674        :param weight: Id of meta attribute with weights of instances 
    37         :type weight: int 
     75        :type weight: :obj:`int` 
     76 
    3877        :rtype: :class:`Orange.multitarget.MultitargetClassifier` 
    3978        """ 
     
    64103 
    65104    def __call__(self, instance, return_type=Orange.core.GetValue): 
     105        """ 
     106        :param instance: Instance to be classified. 
     107        :type instance: :class:`Orange.data.Instance` 
     108 
     109        :param return_type: One of 
     110            :class:`Orange.classification.Classifier.GetValue`, 
     111            :class:`Orange.classification.Classifier.GetProbabilities` or 
     112            :class:`Orange.classification.Classifier.GetBoth` 
     113        """ 
     114 
    66115        predictions = [c(Orange.data.Instance(dom, instance), return_type) 
    67116                       for c, dom in zip(self.classifiers, self.domains)] 
  • orange/Orange/multitarget/tree.py

    r9544 r9553  
    2525MultitargetTreeLearner and use it to predict (multiple) class values for 
    2626a given instance (:download:`multitarget.py <code/multitarget.py>`, 
    27 uses :download:`emotions.tab <code/emotions.tab>`): 
     27uses :download:`test-pls.tab <code/test-pls.tab>`): 
    2828 
    2929.. literalinclude:: code/multitarget.py 
    30    :lines: 1-4, 10-12 
     30    :lines: 1-4, 10-12 
    3131 
    3232 
    3333.. index:: Multi-target Variance  
    3434.. autoclass:: Orange.multitarget.tree.MultitargetVariance 
    35    :members: 
    36    :show-inheritance: 
     35    :members: 
     36    :show-inheritance: 
    3737 
    3838.. index:: Multi-target Tree Learner 
    3939.. autoclass:: Orange.multitarget.tree.MultiTreeLearner 
    40    :members: 
    41    :show-inheritance: 
     40    :members: 
     41    :show-inheritance: 
    4242 
    4343.. index:: Multi-target Tree Classifier 
    4444.. autoclass:: Orange.multitarget.tree.MultiTree 
    45    :members: 
    46    :show-inheritance: 
     45    :members: 
     46    :show-inheritance: 
    4747 
    4848""" 
Note: See TracChangeset for help on using the changeset viewer.