source: orange/orange/doc/modules/svm-test.py @ 7184:96ed65a85e1e

Revision 7184:96ed65a85e1e, 579 bytes checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)
  • added svm-test.py example
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.