scikit-learn / scikit-learn/scikit-learn

Add Kmeans parameter for pruning small clusters

Open
#848 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted Moderate module:cluster New Feature
Dominant language
Python
Stars
67.3k
Forks
27.4k
Avg merge
1d 15h
Merged PRs (30d)
58

Description

In Kmeans, often some clusters have only very little data. This might happen for all random initializations.
For this case, I would like to have an option to set a minimum cluster size, after which a cluster is dropped and a new one is created.

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

Start by locating the Kmeans implementation and its existing tests in scikit-learn. Clarify how a minimum cluster size, dropped clusters, and replacement clusters should behave, then add tests defining the expected results before implementing the option.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.