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

arnike notifications at github.com
Sun Nov 22 11:00:20 EST 2015


Hi there!

There seems to be no check on the cluster size when it's decreased, yet it's used afterwards for update the variance. So, if the cluster size reaches zero, the variance is infinity. As a result, the cluster gets chosen next iteration and causes access to `furthestPoint == data.n_cols`, which is rather sad.
I simply added the same condition as in `Precalculate`.
You can view, comment on, or merge this pull request online at:

  https://github.com/mlpack/mlpack/pull/481

-- Commit Summary --

  * kmeans: small fix with inf variance

-- File Changes --

    M src/mlpack/methods/kmeans/max_variance_new_cluster_impl.hpp (5)

-- Patch Links --

https://github.com/mlpack/mlpack/pull/481.patch
https://github.com/mlpack/mlpack/pull/481.diff

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


More information about the mlpack-git mailing list