source: orange/docs/reference/rst/code/mean-regression.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 698 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

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
9housing = 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, housing)
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.