[mlpack-git] [mlpack] kmeans: small fix with inf variance (#481)

Ryan Curtin notifications at github.com
Mon Nov 23 08:26:27 EST 2015


Hi there,

Thanks for the contribution!  I've merged it in, which will help reduce general sadness (to me, this seems like a good thing).

I also made a slight change: the way `MaxVarianceNewCluster` works is that it will find the cluster with maximum variance and pull points from it to use as the centroids of empty clusters.  But it does this by precalculating (once each iteration) which cluster has maximum variance.  However, the situation you've stumbled upon can only happen if `EmptyCluster()` is called enough times that every point is taken out of the maximum cluster.  Therefore, I've modified things slightly in ec8a151 so that a new cluster with maximum variance is found if the maximum variance cluster has only one point in it.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/481#issuecomment-158932967
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20151123/90fdf9d2/attachment.html>


More information about the mlpack-git mailing list