-
-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
[MRG] Fix empty clusters not correctly relocated #13486
[MRG] Fix empty clusters not correctly relocated #13486
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -922,3 +923,15 @@ def test_iter_attribute(): | |||
estimator = KMeans(algorithm="elkan", max_iter=1) | |||
estimator.fit(np.random.rand(10, 10)) | |||
assert estimator.n_iter_ == 1 | |||
|
|||
|
|||
def test_k_means_empty_cluster_relocated(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ref to this PR maybe?
f031479
to
cca9378
Compare
@NicolasHug I think this PR can be merged |
doc/whats_new/v0.21.rst
Outdated
@@ -88,7 +88,11 @@ Support for Python 3.4 and below has been officially dropped. | |||
- |API| The ``n_components_`` attribute in :class:`cluster.AgglomerativeClustering` | |||
and :class:`cluster.FeatureAgglomeration` has been renamed to | |||
``n_connected_components_``. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like there's a newline at the wrong place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, merged master too quickly...
Thanks @jeremiedbb ! |
…weight(scikit-learn#13486)" This reverts commit 79f12c4.
…weight(scikit-learn#13486)" This reverts commit 79f12c4.
When using sample weights in KMeans, empty clusters are not correctly relocated.
basically what was done is
the added test fails on master