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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)] 
Note: See TracChangeset for help on using the changeset viewer.