source: orange/docs/tutorial/rst/code/bayes_test.py @ 9374:59bac7ddd8a2

Revision 9374:59bac7ddd8a2, 535 bytes checked in by mitar, 2 years ago (diff)

Tutorial documentation structure.

Line 
1# Description: Script that tests bayes.py and compares it to kNN from core Orange
2# Category:    modelling
3# Uses:        voting.tab
4# Classes:     orngTest.crossValidation
5# Referenced:  c_nb.htm
6
7import orange, orngTest, orngStat, bayes
8data = orange.ExampleTable("voting")
9
10bayes = bayes.Learner(m=2, name='my bayes')
11knn = orange.kNNLearner(k=10)
12knn.name = "knn"
13
14learners = [knn,bayes]
15results = orngTest.crossValidation(learners, data)
16for i in range(len(learners)):
17    print learners[i].name, "%.3f" % orngStat.CA(results)[i]
Note: See TracBrowser for help on using the repository browser.