source: orange/docs/reference/rst/code/mean-regression.py @ 9372:aef193695ea9

Revision 9372:aef193695ea9, 694 bytes checked in by mitar, 2 years ago (diff)

Moved documentation to the separate directory.

Line 
1# Description: Shows how to "learn" the mean class and compare other classifiers to the default classification
2# Category:    default classification accuracy, statistics
3# Classes:     MeanLearner, Orange.evaluation.testing.crossValidation
4# Uses:        monks-1
5# Referenced:  mean.htm
6
7import Orange
8
9table = Orange.data.Table("housing")
10
11treeLearner = Orange.classification.tree.TreeLearner() #Orange.regression.TreeLearner()
12meanLearner = Orange.regression.mean.MeanLearner()
13learners = [treeLearner, meanLearner]
14
15res = Orange.evaluation.testing.cross_validation(learners, table)
16MSEs = Orange.evaluation.scoring.MSE(res)
17
18print "Tree:    %5.3f" % MSEs[0]
19print "Default: %5.3f" % MSEs[1]
Note: See TracBrowser for help on using the repository browser.