Orange Forum • View topic - A bug in the KNN code ?

A bug in the KNN 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 KNN code ?

Postby suraj » Tue Oct 31, 2006 22:11

Hi ,
In trying to run the software through some basic datamining steps, I found that the GUI interface throws the following error on being run with one of the sample datasets provided ( fyi - I tried the galaxy set ).
Is there anything I could be doing wrong - or anything more that i need to know ?

Regards ! ,
Suraj

-------- >

Unhandled exception of type exceptions.NameError occured at 16:10:8:
Traceback:
File: orngSignalManager.py in line 215
Function name: processNewSignals
Code: self.widgets[i].processSignals()
File: OWBaseWidget.py in line 307
Function name: processSignals
Code: handler(signalData)
File: OWKNN.py in line 65
Function name: cdata
Code: self.setLearner()
File: OWKNN.py in line 76
Function name: setLearner
Code: self.learn()
File: OWKNN.py in line 81
Function name: learn
Code: self.classifier = self.learner(data)
Exception type: exceptions.NameError
Exception value: global name 'data' is not defined

Postby Janez » Wed Nov 01, 2006 11:54

Suraj,

I was a bit perplexed: I indeed put a broken kNN on the CVS last night, but your bug looked ... different.

So I went into CVS history and discovered that the bug you found was fixed on Oct 5 2004. You must be using a very very old version of Orange. :)

You can fix the code yourself - open orange/OrangeWidgets/Classify/OWKNN.py, line 81 and change self.learner(data) into self.learner(self.data).

But I would suggest downloading something newer, maybe the latest snapshot.

Bye,
Janez

Postby suraj » Thu Nov 02, 2006 21:55

Thanks much Janez ! I appreaciate the help ! :)


Return to Bugs



cron