source: orange/docs/tutorial/rst/code/regression-cv.py @ 11052:c22077a09e63

Revision 11052:c22077a09e63, 525 bytes checked in by blaz <blaz.zupan@…>, 16 months ago (diff)

new tutorial

Line 
1import Orange
2
3data = Orange.data.Table("housing.tab")
4
5lin = Orange.regression.linear.LinearRegressionLearner()
6lin.name = "lin"
7earth = Orange.regression.earth.EarthLearner()
8earth.name = "mars"
9tree = Orange.regression.tree.TreeLearner(m_pruning = 2)
10tree.name = "tree"
11
12learners = [lin, earth, tree]
13
14res = Orange.evaluation.testing.cross_validation(learners, data, folds=5)
15mse = Orange.evaluation.scoring.RMSE(res)
16
17print "Learner  RMSE"
18for i in range(len(learners)):
19  print "%-7s %5.2f" % (learners[i].name, mse[i])
Note: See TracBrowser for help on using the repository browser.