source: orange/Orange/testing/regression/tests_20/modules_svm-custom-kernel.py @ 11613:1242f06bbdb4

Revision 11613:1242f06bbdb4, 1.1 KB checked in by Ales Erjavec <ales.erjavec@…>, 10 months ago (diff)

Fixed changed regression tests output.

RevLine 
[9952]1import orange, orngSVM
2data=orange.ExampleTable("iris.tab")
3l1=orngSVM.SVMLearner()
4l1.kernelFunc=orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5)
5l1.kernel_type=orange.SVMLearner.Custom
6l1.probability=True
7c1=l1(data)
8l1.name="SVM - RBF(Euclidean)"
9
10l2=orngSVM.SVMLearner()
11l2.kernelFunc=orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Hamming(data), gamma=0.5)
12l2.kernel_type=orange.SVMLearner.Custom
13l2.probability=True
14c2=l2(data)
15l2.name="SVM - RBF(Hamming)"
16
17l3=orngSVM.SVMLearner()
18l3.kernelFunc=orngSVM.CompositeKernelWrapper(orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5),orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Hamming(data), gamma=0.5), l=0.5)
19l3.kernel_type=orange.SVMLearner.Custom
20l3.probability=True
21c3=l1(data)
22l3.name="SVM - Composite"
23
24
25import orngTest, orngStat
26tests=orngTest.crossValidation([l1, l2, l3], data, folds=5)
27[ca1, ca2, ca3]=orngStat.CA(tests)
[11613]28print l1.name, "CA: %.2f" % ca1
29print l2.name, "CA: %.2f" % ca2
30print l3.name, "CA: %.2f" % ca3
Note: See TracBrowser for help on using the repository browser.