source: orange/docs/reference/rst/code/optimization-thresholding1.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 578 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

Line 
1import Orange
2
3bupa = 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], 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.