source: orange/docs/tutorial/rst/code/classification-classifier2.py @ 11052:c22077a09e63

Revision 11052:c22077a09e63, 345 bytes checked in by blaz <blaz.zupan@…>, 16 months ago (diff)

new tutorial

Line 
1import Orange
2
3data = Orange.data.Table("voting")
4classifier = Orange.classification.bayes.NaiveLearner(data)
5target = 1
6print "Probabilities for %s:" % data.domain.class_var.values[target]
7for d in data[:5]:
8    ps = classifier(d, Orange.classification.Classifier.GetProbabilities)
9    print "%5.3f; originally %s" % (ps[target], d.getclass())
Note: See TracBrowser for help on using the repository browser.