Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

r - Clustering algorithm for obtaining equal sized clusters

I am trying to form clusters around medoids using PAM algorithm in R. Is there anyway of fixing the cluster size for PAM (somewhat bruteforce the cluster size) ? Are there any other clustering algorithms that will provide equal sized clusters for medoids ?

Thank you in advance for your help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can modify a clustering algorithm to suit your needs.

You can follow this Tutorial for Same-Size K-Means, or simply use this algorithm from the tutorial package/module in ELKI (build the latest version from GitHub, because I just fixed a bug there - this will be included in ELKI 0.7.2).

Essentially, this algorithm performs a k-means style least-squares optimization, but all clusters must have the same size (if N/k is not integer, the cluster sizes may vary by 1).

If you go to above tutorial and scroll to the bottom, you can see example results.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...