Orange Forum • View topic - Problems with cluster analysis and _orngCRS

Problems with cluster analysis and _orngCRS

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.

Problems with cluster analysis and _orngCRS

Postby andrewjg » Wed Dec 02, 2009 3:11

Hi All,

I was quite excited to find Orange, but not so excited about having problems using it for clustering analysis. I've tried this on both Linux and Windows and still can't get it to run, different problems on each though.

On Linux, when working through the examples at:

http://www.stat.columbia.edu/~jakulin/orng/orngCluster.htm

when doing:

from orngCluster import *

I inititially got the "missing _orngCRS module" error. So, I then tried building orngCRS from the source from here:

http://www.stat.columbia.edu/~jakulin/orng/orngExtn-1_8_2_py23.zip

which seemed to install OK (python setup.py install) but I now get:

>>> from orngCluster import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/orange/orngCluster.py", line 24, in <module>
import orngCRS
File "/usr/lib/python2.6/dist-packages/orange/orngCRS.py", line 34, in <module>
SVMLearnS = _orngCRS.SVMLearnS
AttributeError: 'module' object has no attribute 'SVMLearnS'

(my Python is 2.6, btw).

Looking at the source it seems that _orngCRS has no SVMLearnS attribute, having only:

>>> dir (_orngCRS)
['DFCluster', 'DHCluster', 'DMCluster', 'FCluster', 'HCluster', 'LogReg', 'MCluster', 'SVMClassifier', 'SVMClassify', 'SVMClassifyM', 'SVMLearn', '__doc__', '__file__', '__name__', '__package__', 'svm_destroy_model']

I also tried building the source from:

http://www.ailab.si/svn/orange/trunk/add-ons/orngCRS/

but that just wouldn't build.

Any ideas ??? I'd *really* like to get this working.

Chees, Andrew.

Postby Ales » Wed Dec 02, 2009 13:30

Can you use orngClustring module and orange.HierarchicalClustering instead of orngCRS module (It is obsolete and no longer suported). Documentation for those is at
http://www.ailab.si/orange/doc/reference/clustering.htm and http://www.ailab.si/orange/doc/modules/orngClustering.htm

Postby andrewjg » Thu Dec 03, 2009 3:55

Hi Ales,

Thanks for that. However, when I try to run the K-means examples at:

http://www.ailab.si/orange/doc/modules/orngClustering.htm

I get, e.g.:

>>> import orange
>>> import orngClustering
>>> data = orange.ExampleTable("iris.tab")
>>> km = orngClustering.KMeans(data, 3)
>>> print km.clusters[-10:]
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

which, from the docs, should give me:

[1, 1, 2, 1, 1, 1, 2, 1, 1, 2]

(or is this to be expected ?)

and when I try:

>>> import orange
>>> import orngClustering
>>> def callback(km):
... print "Iteration: %d, changes: %d, score: %.4f" % (km.iteration, km.nchanges, km.score)
...
>>> data = orange.ExampleTable("iris")
>>> km = orngClustering.KMeans(data, 3, inner_callback = callback)

I get:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/orange/orngClustering.py", line 243, in __init__
self.run()
File "/usr/lib/python2.6/dist-packages/orange/orngClustering.py", line 283, in run
self.inner_callback(self)
File "<stdin>", line 2, in callback
AttributeError: KMeans instance has no attribute 'score'

So, I presume the documentation is a little out of date ? Otherwise, I continue onwards and thanks again for your help :-)

Cheers, Andrew.

Postby Ales » Thu Dec 03, 2009 13:36


>>> import orange
>>> import orngClustering
>>> data = orange.ExampleTable("iris.tab")
>>> km = orngClustering.KMeans(data, 3)
>>> print km.clusters[-10:]
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

which, from the docs, should give me:

[1, 1, 2, 1, 1, 1, 2, 1, 1, 2]

(or is this to be expected ?)


By default KMeans uses random centroid initialization using python random module. So if you run the above code in a fresh python session it should return the same output as in the documentation. (I am assuming python random generator is not platform specific)

>>> km = orngClustering.KMeans(data, 3, inner_callback = callback)


Try this instead
Code: Select all
>>> km = orngClustering.KMeans(data, 3, minscorechange=0, inner_callback=callback)

Postby Guest » Sat Feb 20, 2010 14:58

Hi all,

My name is dwi. I need help to implement Fuzzy Decision Tree in orange. When i use FCluster in orange_CRS, it can not run. they need _orangeCRS but when i install, it can not run.

and i use orngClustering, but not support for the FCluster.
I need your help how to implement Fuzzy Decision Tree in orange.

Thanks.


Return to Bugs