7.6 Fuzzy c-Means Clustering
■
233
dMemTot[ic]=0.0;
}
For each vector (row), we extract the data values and the cur-
rent degree of membership in each of the clusters. From this we
sum the memberships and calculate the proportional degree of the
data space extent based on the membership. This is the nominator
(upper part, for the algebraically challenged) of the center of gravity
calculation.
for(i=0;i<iRows;i++)
{
for(j=0;j<lVarCount;j++)
dX[j]=XFCCtl.dpXFCData[i][j];
for(j=0;j<lCentersCnt;j++)
dMem[j]=XFCCtl.dpXFCDom[i][j];
for(ic=0;ic<lCentersCnt;ic++)
{
dMemTot[ic]+=dMem[ic];
for(k=0;k<lVarCount;k++)
XFCCtl.dpXFCCenters[ic][k]+=dX[k]*dMem[ic];
}
}
To complete the centroid calculation, the nominator of each center
is divided by the sum of the memberships. (For ...