List behaviours with Clustering Algorithm

James Ravenscroft james at funkymonkeysoftware.com
Mon Jan 24 16:15:23 EST 2011


Peter



> > I can't run your code because you didn't make it standalone,
Thanks for the heads up,  I've made a simple version of the clusterer
which you can view on pastebin: http://pastebin.com/7HmAkmfj If you have time to look through
my code I would be very grateful!



> > but in your case that is probably not enough. 
> > Try something along these lines:
> >
> > # untested
> > while len(self.clusters) > 1:
> >     c = self.clusters.pop()
> >     # find closest index
> >     for i, c2 in enumerate(self.clusters):
> >         ...
> >         if ...:
> >             closest_index = i
> >     closest = self.clusters.pop(closest_index)
> >     tmp.append(c + closest)
> > if self.clusters:
> >    tmp.append(self.clusters[0])
I had a go at implementing something along the lines above and I'm still
getting very bizarre results. There does appear to be some sort of logic
to it though, if you look at the graph chart, you can see that It seems
to be doing the clustering right and then forgetting to remove the old
groupings providing this "cloning" effect for some cluster groups.

Chart: http://img826.imageshack.us/i/clusters.png/

Thanks,

James

-- James Ravenscroft Funky Monkey Software - Bespoke Web and Software
Solutions http://www.funkymonkeysoftware.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110124/ad3b050d/attachment-0001.html>


More information about the Python-list mailing list