-
-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Using ndarray as init
for KMeans
raises a ValueError
#26657
Merged
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2b0a9bd
When init is specified as a numpy array, it errors with "ValueError: …
bnsh dd34560
Merge branch 'main' into main
bnsh 7be0252
Handle callable inits as well as array like inits. Added test case.
bnsh 6fcc539
Formatting for Black
bnsh 79b3b05
Added n_init changes to KMeans and MiniBatchKMeans doc strings.
bnsh 992ade2
Typo. parametrize not parameterize.
bnsh 717cace
Black: Line too long.
bnsh 1103a5d
More black formatting woes.
bnsh a6d2581
Added n_init docs for kmeans function, added a . for more formatting.
bnsh 00b8abc
Added entry in Changelog
bnsh 6bbd3ad
Pull Request needs to be in backquotes not double quotes.
bnsh 1f42d0c
Comment change: unbalanced backquotes and single quotes.
bnsh 0895f9d
"The check that init has a valid type and value is already taken care…
bnsh 30bc7ea
Excessive detail for "What's New"
bnsh e4088eb
Change to docstring: Simplified initialization cases.
bnsh aa37c7c
Formatting. Whitespace.
bnsh e62bd30
Needs a period.
bnsh 04d751d
Update v1.3.rst
jeremiedbb File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
We should as well deal with the callable. So let's do the following:
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.
Hi @glemaitre ... OK, so I added the changes you mention.. (Tho I changed it a little bit from what you wrote.. I more explicitly demand that self.init be either "k-means++" or "random" if it's a string, and either a callable or array like otherwise, and it raises an Exception otherwise.) I also added the docstring changes and the test case, but I don't know what I'm expected to do with the
doc/whats_new/v1.3.rst
... Can you please tell me what exactly I should be doing there? (That seems to be the only thing that's not passing CI/CD checks...)Thanks!
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.
Actually, I think I kind of figured out the Changelog thing. Or at least it's passing the CI/CD check now. I still don't know tho, if the text in there is any good..