Borrar filtros
Borrar filtros

Clustering

1 visualización (últimos 30 días)
shyam Kumar
shyam Kumar el 3 de Abr. de 2011
Respondida: VM Sreeram el 27 de Jun. de 2023
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

Respuestas (1)

VM Sreeram
VM Sreeram el 27 de Jun. de 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.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by