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

Make sure specifying default value or nothing behaves the same in KMeans #6331

Open
wants to merge 5 commits into
base: branch-25.04
Choose a base branch
from

Conversation

betatim
Copy link
Member

@betatim betatim commented Feb 18, 2025

Specifying the default value of a constructor argument or not specifying it at all should behave the same when the accelerator is turned on.

This only fixes up KMeans(init=...), there might be more cases where this is needed.

Also adds a "not implemented" for the elkan algorithm.

Specifying the default value of a constructor argument or not specifying
it at all should behave the same.
@betatim betatim requested a review from a team as a code owner February 18, 2025 14:31
@betatim betatim added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 18, 2025
@github-actions github-actions bot added the Cython / Python Cython or Python issue label Feb 18, 2025
@@ -196,6 +196,18 @@ class KMeans(UniversalBase,
<http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html>`_.
"""

_hyperparam_interop_translator = {
"init": {
# k-means++ would work, but setting it explicitly changes the configuration
Copy link
Member

Choose a reason for hiding this comment

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

great find!

@betatim betatim changed the title Make sure specifying default value or nothing behaves the same in `KMeans Make sure specifying default value or nothing behaves the same in KMeans Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuml-cpu Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants