diff options
Diffstat (limited to 'source/testclusters.py')
-rw-r--r-- | source/testclusters.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/testclusters.py b/source/testclusters.py new file mode 100644 index 00000000..0e1e2a32 --- /dev/null +++ b/source/testclusters.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +import clusters + +K = 10 + +blognames,labels,data = clusters.readfile("blogdata1.txt") + +#coords = clusters.scaledown(data) + +print "Generating clusters..." +kclust = clusters.kcluster(data, k=K) +print +print "Clusters:" +for i in range(K): + print "Cluster" + str(i) + print ", ".join([blognames[r] for r in kclust[i]]) + print + + + + +#clusters.draw2d(coords,blognames,jpeg='mds2d.jpg')
\ No newline at end of file |