source: orange/orange/doc/modules/regression.py @ 7652:677f449144fd

Revision 7652:677f449144fd, 595 bytes checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)
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.