source: orange/orange/doc/ofb/bayes_test.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 535 bytes checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

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.