source: orange/docs/reference/rst/code/optimization-thresholding1.py @ 9372:aef193695ea9

Revision 9372:aef193695ea9, 580 bytes checked in by mitar, 2 years ago (diff)

Moved documentation to the separate directory.

Line 
1import Orange
2
3table = Orange.data.Table("bupa")
4
5learner = Orange.classification.bayes.NaiveLearner()
6thresh = Orange.optimization.ThresholdLearner(learner=learner)
7thresh80 = Orange.optimization.ThresholdLearner_fixed(learner=learner, 
8                                                      threshold=0.8)
9res = Orange.evaluation.testing.cross_validation([learner, thresh, thresh80], table)
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.