diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-11-16 14:20:34 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-11-16 14:20:34 +0100 |
commit | 9c7a6eca5f92b0cc3cc23c40b23f8c982fccdd06 (patch) | |
tree | e9009be19dae759459e2272794fab28179d740cd /source/testclusters.py | |
parent | Moved section "Script of installation". (diff) | |
download | newspipe-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.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 |