Orange Forum • View topic - KMEANS

KMEANS

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.

KMEANS

Postby Spectralboy » Mon Jun 27, 2005 23:06

Hello orange-gang:

Just new to this software, although I have some background in classification and CART:

PROBLEM: My KMEANS classifier does not work in the canvas. I get an error in the output window, it appears that it can't find the

:cry: :cry: owkmeans.py script

My install was split between python and orange as I had to load python as admionistrator on EP due to security, orange wass loaded as a user. I don't think this should make a differnce.

Any suggestions? Thanks.

Spectralboy :roll:

More details please?

Postby sesam » Tue Jun 28, 2005 17:28

Are you creating a new widget? Have you seen http://www.ailab.si/orange/doc/widgets on how to make your own widgets?

Maybe you can make a self-test section at the end of your widget with something like this:
Code: Select all
# To test this widget, run from your system prompt
# > python owkmeans.py
# Make sure that referenced sample data is in the same directory
if __name__=="__main__":
    a=QApplication(sys.argv)
    ow=owkmeans()
    a.setMainWidget(ow)
    #adjust for your own input handler
    #dataset = orange.ExampleTable('adult_sample')
    #ow.cdata(dataset)
    ow.show()
    a.exec_loop()
    ow.saveSettings()

Postby Spectralboy » Tue Jun 28, 2005 22:18

Thank you for your reply sesam:

No, I haven't yet done module programming as I just started. Ima trying to run the KMeans classifier in the associate tab folder. Do you know if it works ? Here is the callback message that is returned.



Unhandled exception of type exceptions.ImportError occured at 15:4:9:
Traceback:
File: orngDoc.py in line 238
Function name: addWidget
Code: newwidget = orngCanvasItems.CanvasWidget(self.signalManager,
self.canvas, self.canvasView, widget, self.canvasDlg.defaultPic,
self.canvasDlg)
File: orngCanvasItems.py in line 271
Function name: __init__
Code: exec(code)
File: OWKMeans.py in line 8
Function name: ?
Code: import orange, orngCluster
File: orngCluster.py in line 11
Function name: ?
Code: import orngCRS
File: orngCRS.py in line 4
Function name: ?
Code: import _orngCRS
Exception type: exceptions.ImportError
Exception value: DLL load failed: Invalid access to memory location.

If I run it again this message is generated.

Unhandled exception of type exceptions.AttributeError occured at 15:4:16:
Traceback:
File: orngDoc.py in line 238
Function name: addWidget
Code: newwidget = orngCanvasItems.CanvasWidget(self.signalManager,
self.canvas, self.canvasView, widget, self.canvasDlg.defaultPic,
self.canvasDlg)
File: orngCanvasItems.py in line 273
Function name: __init__
Code: self.instance = eval(code)
Exception type: exceptions.AttributeError
Exception value: 'module' object has no attribute 'OWKMeans'


I am very interested in using Kmeans, and would appreciate the help.
Thanks.

Postby sesam » Thu Jun 30, 2005 10:43

Probably a defect/bug in the version you have. You can try downloading orange anew: http://www.ailab.si/orange/downloads.asp
It was updated yesterday! This is what I have and K-means works there. (Trying it on the iris data set, it gets the classification quite right!)


Return to Bugs



cron