source: orange/docs/reference/rst/code/lasso-example.py @ 9841:05a160804431

Revision 9841:05a160804431, 561 bytes checked in by lanumek, 2 years ago (diff)

Lasso documentation

Line 
1# Description: Lasso regression
2# Category:    regression
3# Uses:        housing
4# Referenced:  Orange.regression.lasso
5# Classes:     Orange.regression.lasso.LassoRegressionLearner Orange.regression.lasso.LassoRegression
6
7import Orange
8
9housing = Orange.data.Table("housing")
10learner = Orange.regression.lasso.LassoRegressionLearner()
11classifier = learner(housing)
12
13# prediction for five data instances and comparison to actual values
14for ins in housing[:5]:
15    print "Actual: %3.2f, predicted: %3.2f " % (ins.get_class(), classifier(ins))
16
17print classifier
18
Note: See TracBrowser for help on using the repository browser.