1
$\begingroup$

How can I cluster while forcing the final clusters to have more or less the same number of objects?

I have just tried kmeans in R, and it does not take this into account.

$\endgroup$
1
$\begingroup$

Clustering is meant to discover structure in the data. Not just partition it with some constraints. I figure you may want to look into data partitioning strategies instead.

Anyway, k-means can be quite easily modified to ensure you have equally sized partitions (they will be just even less meaningful than k-means already are).

Essentially, you build cluster transfer lists. Every object can "vote" to switch to another cluster. But instead of being immediately transferred to the preferred cluster (as in regular k-means), you enforce the transfers to be symmetric: each cluster may only lose as many objects as it receives.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.