Loosened to dist <= stop_thresh to converge in on 1D constant data#28951
Merged
jeremiedbb merged 12 commits intoscikit-learn:mainfrom May 17, 2024
Merged
Loosened to dist <= stop_thresh to converge in on 1D constant data#28951jeremiedbb merged 12 commits intoscikit-learn:mainfrom
dist <= stop_thresh to converge in on 1D constant data#28951jeremiedbb merged 12 commits intoscikit-learn:mainfrom
Conversation
Member
|
Thanks for the PR @akikuno. Please add a non regression test in |
ogrisel
reviewed
May 6, 2024
| # Test convergence using 2D constant data | ||
| x = np.concatenate([np.zeros((10, 10)), np.ones((10, 10))]) | ||
| n_iter = MeanShift().fit(x).n_iter_ | ||
| assert n_iter < 300 |
Member
There was a problem hiding this comment.
I would remove the 2d case. The 1d case is enough as non-regression test.
Contributor
Author
There was a problem hiding this comment.
@ogrisel
Thank you so much for all your guidance! I have learnt a lot.
Contributor
Author
There was a problem hiding this comment.
@ogrisel
Sorry, I mistakenly thought it had already been changed.
I have now removed the 2d case.
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
jeremiedbb
reviewed
May 7, 2024
doc/whats_new/v1.5.rst
Outdated
Comment on lines
+46
to
+48
| - |Efficiency| The `clustering.MeanShift` class has now improved computational speed as it properly converges for constant data. | ||
| :pr:`28951` by :user:`Akihiro Kuno <akikuno>`. | ||
|
|
Member
There was a problem hiding this comment.
I would consider it a bug and move that in the cluster section of the changelog.
Contributor
Author
There was a problem hiding this comment.
@jeremiedbb
Thanks for your updates! I have moved the log to the sklearn.cluster section.
Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
jeremiedbb
added a commit
to jeremiedbb/scikit-learn
that referenced
this pull request
May 20, 2024
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
jeremiedbb
added a commit
that referenced
this pull request
May 21, 2024
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Discussed #28926
What does this implement/fix? Explain your changes.
As @ogrisel suggested, I implemented the condition
dist <= stop_threshin the_mean_shift_single_seedfunction to address the issue ofMeanShiftfailing to converge on 1D constant data within 300 iterations.Any other comments?