Orange Forum • View topic - problem with MDS

problem with MDS

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.

problem with MDS

Postby marko » Sun Sep 17, 2006 14:13

I tried to run the example for MDS and I couldn't get anything out of it. Function Torgerson (it was already commented in the example) also doesn't work (same SystemError).

I'm using orange snapshot from 13.9

Example code:

Code: Select all
import orange, orngMDS, math

data=orange.ExampleTable("../datasets/iris.tab")
dist = orange.ExamplesDistanceConstructor_Euclidean(data)
matrix = orange.SymMatrix(len(data))
for i in range(len(data)):
   for j in range(i+1):
       matrix[i, j] = dist(data[i], data[j])

mds=orngMDS.MDS(matrix)
#mds.Torgerson()
mds.getStress(orngMDS.KruskalStress)

i=0
while 100>i:
    i+=1
    oldStress=mds.avgStress
    for j in range(10): mds.SMACOFstep()
    mds.getStress(orngMDS.KruskalStress)
    if oldStress*1e-3 > math.fabs(oldStress-mds.avgStress):
        break;
for (p, e) in zip(mds.points, data):
    print p, e


Trace:

Code: Select all
marko@fido:~/ornginst/orange/doc/datasets$ python /usr/share/doc/orange/modules/mds1.py

Traceback (most recent call last):
  File "/usr/share/doc/orange/modules/mds1.py", line 22, in ?
    for (p, e) in zip(mds.points, data):
  File "/usr/lib/python2.4/site-packages/orange/orngMDS.py", line 45, in __getattr__
    return self.__dict__["mds"].__dict__[name]
SystemError: Orange class 'OrangeVector<GCPtr<TOrangeVector<float, false> >, true>' not exported to Python

Postby Janez » Mon Sep 18, 2006 10:04

We are aware of this problem. MDS works on MS Windows, but for some reason it fails on Linux due to a mismatch in RTTI. We will solve the problem, but for now please use MDS on Windows, if you can.

Thanks,
Janez


Return to Bugs