source: orange/docs/reference/rst/code/optimization-thresholding1.py @ 10716:5d1600100484

Revision 10716:5d1600100484, 565 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Fixed failing tests.

Line 
1import Orange
2
3bupa = Orange.data.Table("bupa")
4
5learner = Orange.classification.bayes.NaiveLearner()
6thresh = Orange.tuning.ThresholdLearner(learner=learner)
7thresh80 = Orange.tuning.ThresholdLearner_fixed(learner=learner,
8                                                      threshold=0.8)
9res = Orange.evaluation.testing.cross_validation([learner, thresh, thresh80], bupa)
10CAs = Orange.evaluation.scoring.CA(res)
11
12print "W/out threshold adjustement: %5.3f" % CAs[0]
13print "With adjusted thredhold: %5.3f" % CAs[1]
14print "With threshold at 0.80: %5.3f" % CAs[2]
Note: See TracBrowser for help on using the repository browser.