Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tolerance in KMeans is with respect to the norm of the difference of centers. #16058

Closed
vnmabus opened this issue Jan 8, 2020 · 3 comments · Fixed by #16125
Closed

Tolerance in KMeans is with respect to the norm of the difference of centers. #16058

vnmabus opened this issue Jan 8, 2020 · 3 comments · Fixed by #16125

Comments

@vnmabus
Copy link
Contributor

vnmabus commented Jan 8, 2020

The parameter tol is referred in the documentation as tolerance with respect to inertia:

Relative tolerance with regards to inertia to declare convergence.

However the tolerance was never measured against the difference in inertia, but as against the Frobenius norm of the difference in the cluster centers.

center_shift_total = squared_norm(centers_old - centers)
if center_shift_total <= tol:

Either the documentation is wrong here or the check for convergence is wrong.

@madhuracj
Copy link
Contributor

It looks more like the documentation is wrong.

@jeremiedbb
Copy link
Member

Right, the documentation is wrong. Would you like to submit a PR ?

@madhuracj
Copy link
Contributor

Sure, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants