source: orange/Orange/doc/modules/svm-test.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 579 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1import orange, orngSVM
2data = orange.ExampleTable("iris.tab")
3lin = orngSVM.SVMLearner(kernel_type=orngSVM.SVMLearner.Linear, name="SVM - Linear")
4poly = orngSVM.SVMLearner(kernel_type=orngSVM.SVMLearner.Polynomial, name="SVM - Poly")
5rbf = orngSVM.SVMLearner(kernel_type=orngSVM.SVMLearner.RBF, name="SVM - RBF")
6
7learners = [lin, poly, rbf]
8import orngTest, orngStat
9res = orngTest.crossValidation(learners, data)
10print "%15s%8s%8s" % ("Name", "CA", "AUC")
11for l, ca, auc in zip(learners, orngStat.CA(res), orngStat.AUC(res)):
12  print "%-15s   %.3f   %.3f" % (l.name, ca, auc)
Note: See TracBrowser for help on using the repository browser.