source: orange/docs/reference/rst/code/multitarget.py @ 9604:d64445907a61

Revision 9604:d64445907a61, 692 bytes checked in by Lan Zagar <lan.zagar@…>, 2 years ago (diff)

Added a multitarget data set and expanded documentation.

Line 
1import Orange
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()
7
8majority = Orange.classification.majority.MajorityLearner()
9mt_majority = Orange.multitarget.MultitargetLearner(majority)
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])
16
17mt_tree = Orange.multitarget.tree.MultiTreeLearner(max_depth=3)
18c_tree = mt_tree(data)
19print 'Multi-target Tree predictions:\n', c_tree(data[0])
Note: See TracBrowser for help on using the repository browser.