Skip to main content
. 2024 Feb 21;24(5):1391. doi: 10.3390/s24051391
Algorithm 1  Fuzzy C-Means (FCM) Algorithm
  • Input: All time-invariant vectors y¯I(i), with i=1,2,,M.

  • Output: The centres of the clusters, V¯={v¯1,v¯2,,v¯Nc}; the fuzzy partition coefficient, Vpc

  •   Step 1: Set the algorithmic parameters, Nc, m, A¯, and the threshold, ϵ.

  •   Step 2: Randomly initialize a membership matrix, U^iter=[u^ikiter], with 

  •             the iteration iter=1.

  •   Step 3: Compute the cluster centres V¯={v¯1,v¯2,,v¯Nc} using (12).

  •   Step 4: Set iter=iter+1.

  •   Step 5: Compute an updated membership matrix, U^iter=[u^ikiter],

  •             with u^ikiter=u^k(y¯I(i)) using (10).

  •   Step 6: Compare whether U^iter is higher than U^iter1:

  •                   If ||U^iterU^iter1|| is smaller than ϵ,

  •                         then compute the fuzzy partition coefficient, Vpc,

  •                               Vpc=1Mi=1Ncj=1M(uijiter^)2

  •                         goto Step 7.

  •                   Else Set U^iter1 as U^iter and goto Step 3.

  •   Step 7: Return The cluster centres, V^