Orange Forum • View topic - a bug in the SVM code?

a bug in the SVM code?

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

a bug in the SVM code?

Postby vim » Fri Dec 15, 2006 6:58

the test script comes from http://www.ailab.si/orange/doc/modules/orngSVM.htm
first I got a AttributeError:
Traceback (most recent call last):
File "irissvm.py", line 11, in ?
l2.kernelFunc=orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Hamiltonian(data))
AttributeError: 'module' object has no attribute ExamplesDistanceConstructor_Hamiltonian'

after change it from Hamiltonian to Hamming.(no clue here)

On MS Windows, redirect the output from stdout to some text doesn't work:
[D:\data\download\nt]python2.3 irissvm.py
SVM - RBF(Euclidean) CA: 0.906666666667
SVM - RBF(Hamiltonian) CA: 0.386666666667

[D:\data\download\nt]python2.3 irissvm.py> test.txt
SVM - RBF(Euclidean) CA: 0.906666666667 # shouldn't print to consle
SVM - RBF(Hamiltonian) CA: 0.386666666667 #the same
On linux(debian) the result is more verbose (and the redirect works):
testuser@testpc:~/temp/testcode$ python irissvm.py

optimization finished, #iter = 124
nu = 0.961242
obj = -38.789740, rho = 0.026562
nSV = 80, nBSV = 27
Total nSV = 120

SVM - RBF(Euclidean) CA: 0.926666666667
SVM - RBF(Hamiltonian) CA: 0.42

Postby Janez » Fri Dec 15, 2006 23:59

Regarding Hamilton and Hamming: Orange attributed Hamming distance to Hamilton for years. I was pretty embarassed when I discovered it. I renamed it everywhere, but overlooked one single instance (I guess), which you now found. Thanks. :)

The output thing is weird: the two lines for which the redirect does not work are printed with an ordinary Python print statement. Also for the more verbose output: it's printed in the C++ part, but the code should be the same on Linux and Windows.

If you indeed have the same (preferably the latest) version of Orange on both systems and if the output is important for you, tell me and I'll ask the author of this code to check what's wrong.

Postby vim » Sat Dec 16, 2006 12:45

Thanks for the detailed reply Janez, I understand now.
Its version is (orange-win-snap-2006-12-15.exe and orange-linux-snap-2006-12-15.tgz). but it's not a big problem (at least to me). Just append several lines to the logfile. copy and paste is enough.


Return to Bugs



cron