I'm implementing this algorithm here: http://home.dei.polimi.it/matteucc/Clustering/tutorial_html/cmeans.html
I test my implementation with the following data and config:
2 3 4 10 11 12 13 14 15 16 200001.1 200002.2 200003.3
my fuzzifier is
2, the number of clusters
3, max error:
Looking at the data, the perfect cluster centers would be
BUT, here comes the thing and I'm not really sure my implementation is wrong.
Most of the time, the found centroids are
3.09287 which is perfectly fine, BUT sometimes, I have results like:
10. This happens even if I use numbers with smaller difference - for example, using
203, instead of
Is this normal? I doubt so.
P.S. I initialize the membership matrix with
( rand() % 9 + 1 ) / 10.0 ). I think this might be my mistake, but is it?
I have in mind:
The algorithm minimizes intra-cluster variance as well, but has the same problems as k-means; the minimum is a local minimum, and the results depend on the initial choice of weights.
from the wiki article, but I receive only these 2 results and the difference in both results is very significant.
EDIT So, when I run the test with
2 3 4 10 11 12 13 14 15 16 21.1 2.2 23.3
the results are perfectly fine. So, this makes me think about some kind of normalization of the data. I tried
x = ( x - min ) / ( max - min )
but it didn't helped at all.