source: orange/Orange/doc/ofb/classifier.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 374 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Read data, build naive Bayesian classifier and classify first few instances
2# Category:    modelling
3# Uses:        voting.tab
4# Referenced:  c_basics.htm
5
6import orange
7data = orange.ExampleTable("voting")
8classifier = orange.BayesLearner(data)
9for i in range(5):
10    c = classifier(data[i])
11    print "%d: %s (originally %s)" % (i+1, c, data[i].getclass())
Note: See TracBrowser for help on using the repository browser.