Clustering
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
VM Sreeram
il 27 Giu 2023
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 Commenti
Vedere anche
Categorie
Scopri di più su Cluster Analysis and Anomaly Detection in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!