Reordering matrix elements to reflect column and row clustering in naiive python

Posted by bgbg on Stack Overflow See other posts from Stack Overflow or by bgbg
Published on 2010-03-16T15:39:32Z Indexed on 2010/03/16 15:41 UTC
Read the original article Hit count: 635

Filed under:
|
|
|
|

Hello,

I'm looking for a way to perform clustering separately on matrix rows and than on its columns, reorder the data in the matrix to reflect the clustering and putting it all together. The clustering problem is easily solvable, so is the dendrogram creation (for example in this blog or in "Programming collective intelligence"). However, how to reorder the data remains unclear for me.

Eventually, I'm looking for a way of creating graphs similar to the one below using naive Python (with any "standard" library such as numpy, matplotlib etc, but without using R or other external tools).

dendogram

© Stack Overflow or respective owner

Related posts about python

Related posts about clustering