Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python Cluster

Reply
Thread Tools

Python Cluster

 
 
subhabangalore@gmail.com
Guest
Posts: n/a
 
      12-04-2012
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.
 
Reply With Quote
 
 
 
 
Dave Angel
Guest
Posts: n/a
 
      12-04-2012
On 12/04/2012 02:04 PM, http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
 
Ian Kelly
Guest
Posts: n/a
 
      12-04-2012
On Tue, Dec 4, 2012 at 12:04 PM, <(E-Mail Removed)> 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/refe...endrogram.html

 
Reply With Quote
 
Miki Tebeka
Guest
Posts: n/a
 
      12-04-2012
On Tuesday, December 4, 2012 11:04:15 AM UTC-8, (E-Mail Removed) 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
 
Reply With Quote
 
subhabangalore@gmail.com
Guest
Posts: n/a
 
      12-05-2012
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, (E-Mail Removed) 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Mark B ASP .Net 2 09-11-2009 07:09 AM
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Dhruba Bandopadhyay ASP .Net 1 05-25-2006 01:06 AM
Python multithreading on cluster system? Embedding python in PVM? abhinav Python 1 02-19-2006 08:42 PM
Python on Linux Cluster Gurpreet Sachdeva Python 1 12-23-2004 11:24 AM
python + cluster computing Uwe Schmitt Python 1 07-09-2003 08:12 PM



Advertisments