Orange Forum • View topic - [MDS] Graph tab problem

[MDS] Graph tab problem

A place to ask questions about methods in Orange and how they are used and other general support.

[MDS] Graph tab problem

Postby Kamekjay » Mon Feb 18, 2013 17:46

I need your help forum...
i'm trying to have an MDS graph for a text mining project...
my actual flow is file(.tab)->text/preprocess->text/bag of words->text/distance-> MDS
the mds works nice and it runs without errors. but when i go to the graph tab in the color size shape and label options it does not showing anything...if i execute the mds, in the options shows me every words found in the document. why?

i'm trying to have the same graph like the bookexcerpts example https://bitbucket.org/biolab/orange-tex ... at=default

i've tried also to run the mds like a script:
Code: Select all
import orngMDS

# use MDS for visualization
print "running MDS"
mds=orngMDS.MDS(in_data)
mds.run(100)

from pylab import *
colors = ["red", "yellow", "blue"]

points = []
for (i,d) in enumerate(data):
   points.append((mds.points[i][0], mds.points[i][1], d.getclass()))
for c in range(len(data.domain.classVar.values)):
   sel = filter(lambda x: x[-1]==c, points)
   x = [s[0] for s in sel]
   y = [s[1] for s in sel]
   scatter(x, y, c=colors[c])
savefig('mds-books.png', dpi=72)


but the result is an error...
Code: Select all
Running script:
running MDS
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "<string>", line 5, in <module>
  File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Orange/utils/__init__.py", line 199, in wrap_call
    return func(*args, **kwargs)
  File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Orange/projection/mds.py", line 234, in __init__
    self.mds=orangemds.MDS(distances, dim, **kwargs)
TypeError: must be (unspecified), not None
>>>


can anyone help me please?

Re: [MDS] Graph tab problem

Postby Ales » Mon Feb 18, 2013 18:47

Kamekjay wrote:if i execute the mds, in the options shows me every words found in the document. why?
MDS simply allows any (compatible) attribute to be used as a color/shape/label.
Kamekjay wrote:i'm trying to have the same graph like the bookexcerpts example https://bitbucket.org/biolab/orange-tex ... at=default

On the 'bookexerpts' example select the 'type' in the "Color" box.

Re: [MDS] Graph tab problem

Postby Kamekjay » Mon Feb 18, 2013 18:59

ok! i'll try immediately! i'm sorry but i'm learning how to use the mds and how to read the graph


Return to Questions & Support



cron