source: orange/orange/doc/modules/thresholding2.py @ 2344:2f4651ee936c

Revision 2344:2f4651ee936c, 503 bytes checked in by janezd <janez.demsar@…>, 8 years ago (diff)

* empty log message *

Line 
1import orange, orngWrap, orngTest, orngStat
2
3data = orange.ExampleTable("bupa")
4ri2 = orange.MakeRandomIndices2(data, 0.7)
5train = data.select(ri2, 0)
6test = data.select(ri2, 1)
7
8bayes = orange.BayesLearner(train)
9
10thresholds = [.2, .5, .8]
11models = [orngWrap.ThresholdClassifier(bayes, thr) for thr in thresholds]
12
13res = orngTest.testOnData(models, test)
14cm = orngStat.confusionMatrices(res)
15
16print
17for i, thr in enumerate(thresholds):
18    print "%1.2f: TP %5.3f, TN %5.3f" % (thr, cm[i].TP, cm[i].TN)
Note: See TracBrowser for help on using the repository browser.