Skip to content

Change KMeans random_state default to None#6884

Merged
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.08from
jcrist:change-kmeans-random-state-default
Jun 11, 2025
Merged

Change KMeans random_state default to None#6884
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.08from
jcrist:change-kmeans-random-state-default

Conversation

@jcrist
Copy link
Copy Markdown
Member

@jcrist jcrist commented Jun 11, 2025

Previously random_state defaulted to 1 (a fixed seed) rather than None. This PR changes the default to None to match that of every other estimator in cuml. This is a breaking change, but I'd view the previous behavior as unexpected and a bug.

Fixes #6881.

@jcrist jcrist self-assigned this Jun 11, 2025
@jcrist jcrist requested a review from a team as a code owner June 11, 2025 14:27
@jcrist jcrist added Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function labels Jun 11, 2025
@jcrist jcrist requested review from cjnolet and dantegd June 11, 2025 14:27
@jcrist jcrist added the breaking Breaking change label Jun 11, 2025
Copy link
Copy Markdown
Member

@betatim betatim left a comment

Choose a reason for hiding this comment

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

The universe has an endless supply of surprises!

Agree that this is a bug fix, hence I'd not call it a breaking change. But maybe that is just my weird definition where non breaking, breaking and bug fix are mutually exclusive categories 🤷

@jcrist
Copy link
Copy Markdown
Member Author

jcrist commented Jun 11, 2025

It's my understanding that adding the breaking label just elevates changes in the release notes - if that's the case then adding a label on changes that might be worth raising to a user's attention seems at worst harmless.

Previously `random_state` defaulted to `1` (a fixed seed) rather than
`None`. This PR changes the default to `None` to match that of every
other estimator in `cuml`. This is a breaking change, but I'd view the
previous behavior as unexpected and a bug.
@jcrist jcrist force-pushed the change-kmeans-random-state-default branch from 76a9e5c to 6f1e730 Compare June 11, 2025 15:43
@jcrist
Copy link
Copy Markdown
Member Author

jcrist commented Jun 11, 2025

/merge

@rapids-bot rapids-bot Bot merged commit 83f3ef1 into rapidsai:branch-25.08 Jun 11, 2025
67 checks passed
@jcrist jcrist deleted the change-kmeans-random-state-default branch June 11, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KMeans random_state defaults to a fixed seed

4 participants