source: orange/docs/tutorial/rst/code/regression-cv.py @ 11692:356c325c0efb

Revision 11692:356c325c0efb, 541 bytes checked in by Ales Erjavec <ales.erjavec@…>, 7 months ago (diff)

Removed 'Earth' code from Orange (moved to 'orangecontrib.earth' package).

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