# [SciPy-User] inverting pdist.

srean srean.list@gmail....
Wed Apr 18 23:52:49 CDT 2012

I lost you on your description about the index of the largest
distance. If what you are looking for is that given all pairwise
distance ab, ac, ad, bc, bd, cd to find the coordinates of a,b,c and
d, then the problem you are looking for is multidimensional scaling
(MDS). You will get lots of hits if you search for it. In general it
does not have a unique solution. On the other hand if you had all
pairs of dot products (or similarities) you can obtain the coordinates
by an eigen decomposition of the pairwise dot product matrix.

On Mon, Apr 16, 2012 at 9:55 AM, Éric Depagne <eric@depagne.org> wrote:
> Hi.
>
> I'm using scipy.spatial.distance.pdist.
>
> I was wondering if it was possible to invert the result to get the elements of
> the input matrix that produced a given result.
> Let me explain a little.
>
> Say  we have a,b, c and d. The possible distances are ab, ac, ad,  bc, bd and
> cd. pdist will give the values for those 6 distances. Say the largest is at
> index 5. How can I get from the pdist result array that it is the bd distance?
>
>
> And if it is not, is there another way of doing so? My data are such that I
> have close to 100k distances to compute.
>
> Thanks.
> Éric.
>
> Un clavier azerty en vaut deux
> ----------------------------------------------------------
> Éric Depagne                            eric@depagne.org
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

More information about the SciPy-User mailing list