source: orange/docs/reference/rst/code/statExample1.py @ 9372:aef193695ea9

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

Moved documentation to the separate directory.

Line 
1import orange, orngTest, orngTree
2
3learners = [orange.BayesLearner(name = "bayes"),
4            orngTree.TreeLearner(name="tree"),
5            orange.MajorityLearner(name="majrty")]
6
7voting = orange.ExampleTable("voting")
8res = orngTest.crossValidation(learners, voting)
9
10vehicle = orange.ExampleTable("vehicle")
11resVeh = orngTest.crossValidation(learners, vehicle)
12
13import orngStat
14
15CAs = orngStat.CA(res)
16APs = orngStat.AP(res)
17Briers = orngStat.BrierScore(res)
18ISs = orngStat.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.