Evaluation of k-means performance in terms of 'sumd'

조회 수: 3 (최근 30일)
Salad Box
Salad Box 2019년 9월 27일
댓글: Salad Box 2019년 9월 27일
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.
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
Adam
Adam 2019년 9월 27일
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).

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2019년 9월 27일
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.
  댓글 수: 1
Salad Box
Salad Box 2019년 9월 27일
Thanks for the confirmation, I'm going to use sum of 'sumd' with strong confidence.:)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by