Looks to me like the unit tests are the only calls to recomputeCenter, which is where the center is set. The clusterer seems to be calling computeCentroid, which sets the centroid, instead. I'm not sure why it needs both instance variables, as the pointProbSum and weightedPointTotal variables take the place of the single pointTotal in ClusterBase. I think perhaps center and centroid need to be merged?

In k-means and canopy, the center is the (read-only) current centroid which is used for the distance calculations during an iteration, and it is recomputed by computeCentroid (using pointTotal and numPoints) at the end of the iteration.

Jeff


Robin Anil wrote:
I have been trying to convert FuzzyKMeans SoftCluster(which should be
ideally be named FuzzyKmeansCluster) to use the ClusterBase.

I am getting* the same center* for all the clusters. To aid the conversion
all i did was remove the center vector from the SoftCluster class and reuse
the same from the ClusterBase. These are essentially making no change in the
tests which passes correctly.

So I am questioning whether the implementation keeps the average center at
all ? Anyone who has used FuzzyKMeans experiencing this?


Robin


Reply via email to