Hey David,
I'll look into this this weekend or sometime soon. It might be that
there's no good up-to-date tutorial, and you (or somebody, maybe me)
should write one and put it on the new wiki!
Happy hacking,
--
-- alexr
You're right -- the example on that page doesn't work! I'll make sure to fix it.
There is a working example in the demo() function of kmeans.py, though.
http://code.google.com/p/nltk/source/browse/trunk/nltk/nltk/cluster/kmeans.py#167
Also, it works, for me, to type this into the Python repl:
from numpy import array
from nltk import cluster
from nltk.cluster import euclidean_distance
vectors = [array(f) for f in [[3, 3], [1, 2], [4, 2], [4, 0]]]
clusterer = cluster.KMeansClusterer(2, euclidean_distance, repeats=10)
print clusterer.cluster(vectors, True)
Hope this helps!
On Sat, Jul 17, 2010 at 3:27 PM, mystickahuna <chen...@gmail.com> wrote:
> Thanks for spending time solving my problem. I will keep tracking this
> thread. Hope NLTK can become more popular.
--
-- alexr
http://code.google.com/p/nltk/issues/detail?id=578
Thanks for pointing out the problem!
--
-- alexr