Skip to content

Fix prevent infinite loop in KMeans - #28165

Merged
OmarManzoor merged 10 commits into
scikit-learn:mainfrom
jeremiedbb:fix-infinite-loop-kmeans
Jan 19, 2024
Merged

OmarManzoor merged 10 commits into
scikit-learn:mainfrom
jeremiedbb:fix-infinite-loop-kmeans

Conversation

@jeremiedbb

Copy link
Copy Markdown
Member

Fixes #28055

When there are more centers than non-duplicate samples, the relocation of empty cluster will trigger at every iteration preventing the algorithm to stop.

@github-actions

github-actions Bot commented Jan 18, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 1f3d9e3. Link to the linter CI: here

Comment thread sklearn/cluster/tests/test_k_means.py Resolved
@glemaitre
glemaitre self-requested a review January 18, 2024 15:21
Comment thread doc/whats_new/v1.4.rst Resolved

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @jeremiedbb

jeremiedbb and others added 2 commits January 18, 2024 16:33
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @jeremiedbb

@OmarManzoor
OmarManzoor merged commit 26dfe83 into scikit-learn:main Jan 19, 2024
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Feb 10, 2024
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Feb 13, 2024
glemaitre pushed a commit that referenced this pull request Feb 13, 2024
@jeremiedbb
jeremiedbb deleted the fix-infinite-loop-kmeans branch September 3, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite Loop in K-means when relocating empty clusters

3 participants