aboutsummaryrefslogtreecommitdiff
path: root/source/testclusters.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2012-11-16 14:20:34 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2012-11-16 14:20:34 +0100
commit9c7a6eca5f92b0cc3cc23c40b23f8c982fccdd06 (patch)
treee9009be19dae759459e2272794fab28179d740cd /source/testclusters.py
parentMoved section "Script of installation". (diff)
downloadnewspipe-9c7a6eca5f92b0cc3cc23c40b23f8c982fccdd06.tar.gz
newspipe-9c7a6eca5f92b0cc3cc23c40b23f8c982fccdd06.tar.bz2
newspipe-9c7a6eca5f92b0cc3cc23c40b23f8c982fccdd06.zip
Added tests with clusters.
Diffstat (limited to 'source/testclusters.py')
-rw-r--r--source/testclusters.py23
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
bgstack15