source: orange/Orange/testing/regression/tests_20/modules_regression.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 595 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.