NVIDIA / NVIDIA/cuvs

[QST] KmeansPlusPlus Should Scale Probabilities by Sample Weights

Open
#1,809 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Cuda
Stars
854
Forks
236
Avg merge
3d 3h
Merged PRs (30d)
62

Description

It looks like KMeansPlusPlus initialization does not account for the sample weights while sampling centroids. We might need to add the appropriate scaling factor to correctly account for points' importances.

Corresponding line in scikit-learn where the scaling is done:
https://github.com/scikit-learn/scikit-learn/blob/2ff996e74ec4c4ab27208f9a67cba42a8c97833b/sklearn/cluster/_kmeans.py#L263

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the KMeansPlusPlus initialization and compare its centroid-sampling behavior with the linked scikit-learn implementation, especially the referenced scaling line. Confirm the change by checking that sample weights affect centroid sampling probabilities as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
scikit-learn
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.