source: orange/docs/reference/rst/code/statExample1.py @ 9945:ba7e22d4ebc5

Revision 9945:ba7e22d4ebc5, 805 bytes checked in by markotoplak, 2 years ago (diff)

Modernized some example scripts.

Line 
1import Orange
2
3learners = [ Orange.classification.bayes.NaiveLearner(name = "bayes"),
4             Orange.classification.tree.TreeLearner(name="tree"),
5             Orange.classification.majority.MajorityLearner(name="majrty")]
6
7voting = Orange.data.Table("voting")
8res = Orange.evaluation.testing.cross_validation(learners, voting)
9
10vehicle = Orange.data.Table("vehicle")
11resVeh = Orange.evaluation.testing.cross_validation(learners, vehicle)
12
13import orngStat
14
15CAs = Orange.evaluation.scoring.CA(res)
16APs = Orange.evaluation.scoring.AP(res)
17Briers = Orange.evaluation.scoring.Brier_score(res)
18ISs = Orange.evaluation.scoring.IS(res)
19
20print
21print "method\tCA\tAP\tBrier\tIS"
22for l in range(len(learners)):
23    print "%s\t%5.3f\t%5.3f\t%5.3f\t%6.3f" % (learners[l].name, CAs[l], APs[l], Briers[l], ISs[l])
Note: See TracBrowser for help on using the repository browser.