source: orange/Orange/doc/modules/regression.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 595 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Demonstrates the use of linear regression
2# Category:    regression
3# Classes:     LinearRegressionLearner
4# Uses:        housing.tab
5
6import orange
7import orngRegression
8
9data = orange.ExampleTable("housing")
10
11learners = [orngRegression.LinearRegressionLearner()]
12
13
14import orngTest, orngStat
15
16results = orngTest.crossValidation(learners, data)
17
18print "Error:"
19for i in range(len(learners)):
20    print ("%15s: %5.3f") % (learners[i].name, orngStat.MSE(results)[i])
21   
22print
23
24lr = orngRegression.LinearRegressionLearner(name="lr")
25
26orngRegression.printLinearRegression(lr(data))
Note: See TracBrowser for help on using the repository browser.