Evaluation of k-means performance in terms of 'sumd'
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Salad Box
el 27 de Sept. de 2019
Comentada: Salad Box
el 27 de Sept. de 2019
Hi,
To give a simple example:
I have 4 data points p1, p2, p3, p4 (in blue dots). I performed k-means twice with k = 2 and plotted the output centroids for the two clusters C1 and C2 (green dots).
The two iteration of kmeans are shown below (left and right). Noticed that in the second iteration (right), C2 and p2 are in the same location.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/240085/image.png)
To compare the performance of k-means in this two iterations, or to find out which of these two cases is a better clustering, do I just look at 'sumd' which is the sum of the distance of each point to the centroid in that cluster?
In this case, sumd of left is [0.5000, 0.5000] while sumd of right is [1.3333, 0].
In order to compare the two cases,
Do I just sum the 'sumd' of left and get '1', and sum the 'sumd' of right and get '1.3333', and take the smaller number which is '1' and claim left is better clustered?
Am I doing it correctly?
1 comentario
Adam
el 27 de Sept. de 2019
There's not any single definition of what is the 'best' clustering so you have to pick one that you feel fits your case.
I don't have a sumd function in my Matlab so I don't know its specific details and why it gives two numbers (well, one for each cluster seems obvious).
I tend to measure the quantisation error by summing the distance of each point to its defined cluster node, which may or may not be the same thing, relatively, though in that case, normalising by the number of points it would give an error of 0.5 for the left case and something like 0.65 for the right. So I guess that is the same as you averaging over your results (i.e. average distance per cluster).
Respuesta aceptada
the cyclist
el 27 de Sept. de 2019
I agree with Adam's comment that there is not really a single "best" here. One way to think about it is in terms of a "utility function" -- what are you trying to achieve with the clustering, and can you write a mathematical function that captures that?
That being said, the sum of the sumd outputs is certainly a sensible, low-effort metric for the best clustering. After all, the kmeans algorithm itself is attempting to minimize the sumd values.
Más respuestas (0)
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!