[SciPy-Dev] Hiearchical Clustering issue

Rishabh SHARMA rishabh.sharma.gunner at gmail.com
Wed Mar 4 07:56:16 EST 2015


Hello
I have this question,could someone help?

I am using scipy.cluster.hiearchical
***I have a distance matrix in squareform  't' as
array([[  0.00000000e+00,   3.44600000e+03,   6.75000000e+02,
           2.06000000e+03,   2.24205600e+06],
        [  3.44600000e+03,   0.00000000e+00,   2.77300000e+03,
           1.75000000e+03,   2.23959500e+06],
        [  6.75000000e+02,   2.77300000e+03,   0.00000000e+00,
           1.49100000e+03,   2.24154200e+06],
        [  2.06000000e+03,   1.75000000e+03,   1.49100000e+03,
           0.00000000e+00,   2.24127000e+06],
        [  2.24205600e+06,   2.23959500e+06,   2.24154200e+06,
           2.24127000e+06,   0.00000000e+00]])

***I used this cmd
z=linkage(t,method='complete') //t is the above matrix
z
array([[  0.00000000e+00,   2.00000000e+00,   1.39718861e+03,
           2.00000000e+00],
        [  1.00000000e+00,   3.00000000e+00,   3.53484724e+03,
           2.00000000e+00],
        [  5.00000000e+00,   6.00000000e+00,   5.85696654e+03,
           4.00000000e+00],
        [  4.00000000e+00,   7.00000000e+00,   5.00927065e+06,
           5.00000000e+00]])

**Question: why in the first row of z where objects 0,2 are merged the
distance is shown as 1.397e+3[3rd element of 1st row] whereas it should
the distance given by t[0][2] as in distance matrix(these objects are
original objects/leaf nodes)

Thanks

PS: I posted the question in user list,but no one seems to have the
answer.In any case sorry for spamming dev list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150304/52b8cc6d/attachment.html>


More information about the SciPy-Dev mailing list