Changeset 9604:d64445907a61 in orange


Ignore:
Timestamp:
01/30/12 15:56:42 (2 years ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
rebase_source:
617477fff7508c5dfbbaf584e3c6a0554963a672
Message:

Added a multitarget data set and expanded documentation.

Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/code/multitarget.py

    r9534 r9604  
    11import Orange 
    2 data = Orange.data.Table('test-pls') 
    3 print 'Actual classes:\n', data[0].get_classes() 
     2data = Orange.data.Table('multitarget-synthetic') 
     3print 'Features:', data.domain.features 
     4print 'Classes:', data.domain.class_vars 
     5print 'First instance:', data[0] 
     6print 'Actual classes:', data[0].get_classes() 
    47 
    58majority = Orange.classification.majority.MajorityLearner() 
    69mt_majority = Orange.multitarget.MultitargetLearner(majority) 
    7 c_mtm = mt_majority(data) 
    8 print 'Majority predictions:\n', c_mtm(data[0]) 
     10c_majority = mt_majority(data) 
     11print 'Majority predictions:\n', c_majority(data[0]) 
     12 
     13pls = Orange.multitarget.pls.PLSRegressionLearner() 
     14c_pls = pls(data) 
     15print 'PLS predictions:\n', c_pls(data[0]) 
    916 
    1017mt_tree = Orange.multitarget.tree.MultiTreeLearner(max_depth=3) 
    11 c_mtt = mt_tree(data) 
    12 print 'Multi-target Tree predictions:\n', c_mtt(data[0]) 
     18c_tree = mt_tree(data) 
     19print 'Multi-target Tree predictions:\n', c_tree(data[0]) 
  • orange/Orange/multitarget/__init__.py

    r9554 r9604  
    2121======== 
    2222 
    23 The following example demonstrates how to build a prediction model for 
    24 multi-target data and use it to predict (multiple) class values for 
    25 a new instance (:download:`multitarget.py <code/multitarget.py>`, 
    26 uses :download:`test-pls.tab <code/test-pls.tab>`): 
     23The following example uses a simple multi-target data set (generated with 
     24:download:`generate_multitarget.py <code/generate_multitarget.py>`) to show 
     25some basic functionalities (part of 
     26:download:`multitarget.py <code/multitarget.py>`, uses 
     27:download:`multitarget-synthetic.tab <code/multitarget-synthetic.tab>`). 
    2728 
    2829.. literalinclude:: code/multitarget.py 
     30    :lines: 1-6 
     31 
     32Multi-target learners can be used to build prediction models (classifiers) 
     33which then predict (multiple) class values for a new instance (continuation of 
     34:download:`multitarget.py <code/multitarget.py>`): 
     35 
     36.. literalinclude:: code/multitarget.py 
     37    :lines: 8- 
    2938 
    3039""" 
Note: See TracChangeset for help on using the changeset viewer.