source: orange/Orange/testing/regression/tests_20/modules_svm-test.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 579 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.