Python Cluster

Ian Kelly ian.g.kelly at gmail.com
Tue Dec 4 16:02:07 EST 2012


On Tue, Dec 4, 2012 at 12:04 PM, <subhabangalore at gmail.com> wrote:

> Dear Group,
>
> I am trying to use the cluster module as,
> >>> from cluster import *
> >>> data = [12,34,23,32,46,96,13]
> >>> cl = HierarchicalClustering(data, lambda x,y: abs(x-y))
> >>> cl.getlevel(10)
> [[96], [46], [12, 13, 23, 34, 32]]
> >>> cl.getlevel(5)
> [[96], [46], [12, 13], [23], [34, 32]]
>
> but now I want to visualize it if any one suggest how may I use
> visualization(like matplotlib or pyplot etc.) to see the data?
>

You mean like a dendrogram?  Scipy has support for that.  It uses
matplotlib to do the actual plotting.

http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.dendrogram.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121204/c61f4497/attachment.html>


More information about the Python-list mailing list