Clustering
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I need to cluster the coordinates of 400 cells into 20 clusters with each cluster HAVING THE SAME NUMBER OF ELEMENTS. Is it possible to do this by kmeans. Can K means ensure that each cluster has the same number of elements ?
thanks in advance,
Shyam
0 件のコメント
回答 (1 件)
VM Sreeram
2023 年 6 月 27 日
k-means clustering, is an algorithm that assigns n observations to exactly one of k clusters defined by centroids, where k is chosen before the algorithm starts [1].
It means that even we run k-means with k = 400/20 = 20, it does not guarentee that each cluster has equal number of elements.
If you want to ensure that each cluster has equal number of elements, you may run a post-processing step, wherein you reassign datapoints between clusters to balance the cluster sizes. One approach is to iteratively reassign the data points from the largest clusters to the smallest clusters until all clusters have the desired number of elements.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Cluster Analysis and Anomaly Detection についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!