source: orange/docs/reference/rst/code/pls-example.py @ 9776:600ac31393ee

Revision 9776:600ac31393ee, 721 bytes checked in by lanumek, 2 years ago (diff)

documentation for regression: lasso, linear, pls

Line 
1# Description: Partial least squares regression
2# Category:    regression
3# Uses:        multitarget-synthetic
4# Referenced:  Orange.regression.pls
5# Classes:     Orange.regression.pls.PLSRegressionLearner, Orange.regression.pls.PLSRegression
6
7import Orange
8
9data = Orange.data.Table("multitarget-synthetic.tab")
10print "Input variables:    ", data.domain.features
11print "Response variables: ", data.domain.class_vars
12   
13learner = Orange.multitarget.pls.PLSRegressionLearner()
14classifier = learner(data)
15
16print "Prediction for the first 2 data instances: \n" 
17for d in data[:2]:
18    print "Actual    ", d.get_classes()
19    print "Predicted ", classifier(d)
20    print 
21
22print 'Regression coefficients:\n', classifier   
Note: See TracBrowser for help on using the repository browser.