Thu Jul 22 14:31:13 CDT 2010
On Thu, Jul 22, 2010 at 3:15 PM, Keith Goodman <firstname.lastname@example.org> wrote:
> You'd like to minimize the squared error (I don't know much about it
> but that makes sense to me). But in the example you chose, the squared
> error is minimized since the mean is 4. Was that just a coincidence? I
> guess in the end the code is protected against any claims of bugs
> since it doesn't guarantee to find the global minimum :)
This was not really a coincidence, because the algorithm converges to a
local minimum of sum of squared distances. This is why I was suggesting
using this sum of squared distances as a stopping criterion and returning
this value instead of the distortion. Or alternatively we could use the
k-means code Benjamin mentioned if he digs it up and if it allows multiple
distance functions and has a reasonable stopping criterion.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User