source: orange/docs/reference/rst/code/lasso-example.py @ 10042:a8ced38d2fd1

Revision 10042:a8ced38d2fd1, 432 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Set the numpy random seed.

Line 
1# Description: Lasso regression
2# Category:    regression
3
4import Orange
5import numpy
6
7numpy.random.seed(0)
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.