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

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

new tutorial

Line 
1import Orange
2
3data = Orange.data.Table("voting")
4
5tree = Orange.classification.tree.TreeLearner(sameMajorityPruning=1, mForPruning=2)
6tree.name = "tree"
7nbc = Orange.classification.bayes.NaiveLearner()
8nbc.name = "nbc"
9lr = Orange.classification.logreg.LogRegLearner()
10lr.name = "lr"
11
12learners = [nbc, tree, lr]
13print " "*9 + " ".join("%-4s" % learner.name for learner in learners)
14res = Orange.evaluation.testing.cross_validation(learners, data, folds=5)
15print "Accuracy %s" % " ".join("%.2f" % s for s in Orange.evaluation.scoring.CA(res))
16print "AUC      %s" % " ".join("%.2f" % s for s in Orange.evaluation.scoring.AUC(res))
Note: See TracBrowser for help on using the repository browser.