Orange Forum • View topic - MDS: superimposition of graph of similar pairs

MDS: superimposition of graph of similar pairs

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

MDS: superimposition of graph of similar pairs

Postby jlara » Fri Feb 06, 2009 1:15

Dear Sirs,

What is the algorithm implemented in the MDS module to draw connections and for showing a graph of a specified proportion of the most similar pairs? How are the similarities between connected instances (points) determined?

Also, I noticed that on WINDOWS I get different representation on the width of the connections showing similarity when compared to executing on UBUNTU. Are there differences on the way the algorithm is implemented, i.e., showing similarity (WINDOWS) vs showing distances by line width (UBUNTU)? Note: in both cases I used the SVN versions of Orange: WINDOWS revision 6935, and UBUNTU revision 7023. For testing I used the from UCI repository.

Postby Janez » Fri Feb 06, 2009 11:13

The algorithm is nothing fancy. If you have n points and want to see the p most similar pair, it simply takes the p*n*(n-1)/2 closest pairs and connects them. Similarity is just the opposite of distance. So basically, you provide the MDS with a matrix of distances and the widget connects the points which correspond to the p*n*(n-1)/2 smallest elements in the matrix.

The lines are max(1, (maxdist - dist)**2 * k) pixels wide, where dist is the distance from your matrix, k is 3/(maxdist - mindist)**2, and maxdist and mindist are the largest and the smallest distance among those which are shown in the plot.

You can find the code in orange/OrangeWidgets/Unsupervised/, see function updateDistanceLines. It should be easy to read even if you don't know any Python.

The code is the same for Windows and Ubuntu. Any differences in rendering are due to differences in Qt (or Qwt) for Windows and Linux.

Return to Questions & Support