Python Cluster

S

subhabangalore

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.
 
D

Dave Angel

Dear Group,

I am trying to use the cluster module as,

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.
 
I

Ian Kelly

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top