joshlk / k-means-constrained

K-Means clustering - constrained with minimum and maximum cluster size. Documentation: https://joshlk.github.io/k-means-constrained
https://github.com/joshlk/k-means-constrained
BSD 3-Clause "New" or "Revised" License
192 stars 43 forks source link

"Relative Tolerance" Definition #14

Closed delivermore closed 3 years ago

delivermore commented 3 years ago

There is an error in the documentation that shadows a previous error in the KMeans documentation: specifically, it states that the relative tolerance is with respect to the inertia, when in fact it is with respect to the norm of the change in centroid positions.

See: https://github.com/scikit-learn/scikit-learn/issues/16058

Incidentally, it might be helpful when outputting data when verbose=True to include the current norm at each iteration. For example:

Iteration 51, inertia 497.000

would become:

Iteration 51, inertia 497.000, centre-shift 0.01425.

That being said sklearn doesn't do that so for the sake of compatibility, probably best not to.

joshlk commented 3 years ago

Hi, thanks for the heads up 😃 . I have updated the documentation to reflectx this. It has been updated online but I haven't done another release yet.