Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34246 > unrolled thread

Python Cluster

Started bysubhabangalore@gmail.com
First post2012-12-04 11:04 -0800
Last post2012-12-04 18:36 -0800
Articles 5 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  Python Cluster subhabangalore@gmail.com - 2012-12-04 11:04 -0800
    Re: Python Cluster Dave Angel <d@davea.name> - 2012-12-04 14:25 -0500
    Re: Python Cluster Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-04 14:02 -0700
    Re: Python Cluster Miki Tebeka <miki.tebeka@gmail.com> - 2012-12-04 13:03 -0800
      Re: Python Cluster subhabangalore@gmail.com - 2012-12-04 18:36 -0800

#34246 — Python Cluster

Fromsubhabangalore@gmail.com
Date2012-12-04 11:04 -0800
SubjectPython Cluster
Message-ID<7de5b6b5-a8fa-471a-b5df-3c03adb21640@googlegroups.com>
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?

Thanking in advance,
Regards,
Subhabrata.

[toc] | [next] | [standalone]


#34247

FromDave Angel <d@davea.name>
Date2012-12-04 14:25 -0500
Message-ID<mailman.469.1354649139.29569.python-list@python.org>
In reply to#34246
On 12/04/2012 02:04 PM, subhabangalore@gmail.com wrote:
> Dear Group,
>
> I am trying to use the cluster module as,
>>>> from cluster import *

No such module in the stdlib.

Start by showing what OS, what Python version, and what external
libraries you've installed and are using, and only then can you ask a
meaningful question.



-- 

DaveA

[toc] | [prev] | [next] | [standalone]


#34254

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-12-04 14:02 -0700
Message-ID<mailman.476.1354654960.29569.python-list@python.org>
In reply to#34246

[Multipart message — attachments visible in raw view] — view raw

On Tue, Dec 4, 2012 at 12:04 PM, <subhabangalore@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

[toc] | [prev] | [next] | [standalone]


#34255

FromMiki Tebeka <miki.tebeka@gmail.com>
Date2012-12-04 13:03 -0800
Message-ID<fb14ec6c-a0d4-47af-9c28-a2c90abb1356@googlegroups.com>
In reply to#34246
On Tuesday, December 4, 2012 11:04:15 AM UTC-8, subhaba...@gmail.com wrote:
> >>> cl = HierarchicalClustering(data, lambda x,y: abs(x-y))
> 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?
One option is to use a scatter plot with different color per cluster. See the many examples in http://matplotlib.org/gallery.html.

HTH,
--
Miki

[toc] | [prev] | [next] | [standalone]


#34269

Fromsubhabangalore@gmail.com
Date2012-12-04 18:36 -0800
Message-ID<68fd3de7-8b7f-41fb-9768-d533ca4aaa57@googlegroups.com>
In reply to#34255
On Wednesday, December 5, 2012 2:33:56 AM UTC+5:30, Miki Tebeka wrote:
> On Tuesday, December 4, 2012 11:04:15 AM UTC-8, subhaba...@gmail.com wrote:
> 
> > >>> cl = HierarchicalClustering(data, lambda x,y: abs(x-y))
> 
> > 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?
> 
> One option is to use a scatter plot with different color per cluster. See the many examples in http://matplotlib.org/gallery.html.
> 
> 
> 
> HTH,
> 
> --
> 
> Miki

Thanks Miki. Good Gallery I think it'd do. We can plot as we feel. Regards,Subhabrata.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web