Fuzzy c-means (FCM) is a clustering method that allows each
data point to belong to multiple clusters with varying degrees of
membership.

FCM is based on the minimization of the following objective
function

$${J}_{m}={\displaystyle \sum _{i=1}^{D}{\displaystyle \sum _{j=1}^{N}{\mu}_{ij}^{m}{\Vert {x}_{i}-{c}_{j}\Vert}^{2}}},$$

where

*D* is the number of data points.

*N* is the number of clusters.

*m* is fuzzy partition matrix exponent
for controlling the degree of fuzzy overlap, with *m* >
1. Fuzzy overlap refers to how fuzzy the boundaries
between clusters are, that is the number of data points that have
significant membership in more than one cluster.

*x*_{i} is the *i*th
data point.

*c*_{j} is the
center of the *j*th cluster.

*μ*_{ij} is
the degree of membership of *x*_{i} in
the *j*th cluster. For a given data point, *x*_{i},
the sum of the membership values for all clusters is one.

`fcm`

performs the following steps during
clustering:

Randomly initialize the cluster membership values, *μ*_{ij}.

Calculate the cluster centers:

$${c}_{j}=\frac{{\displaystyle \sum _{i=1}^{D}{\mu}_{ij}^{m}{x}_{i}}}{{\displaystyle \sum _{i=1}^{D}{\mu}_{ij}^{m}}}.$$

Update *μ*_{ij} according
to the following:

$${\mu}_{ij}=\frac{1}{{\displaystyle \sum _{k=1}^{N}{\left(\frac{\Vert {x}_{i}-{c}_{j}\Vert}{\Vert {x}_{i}-{c}_{k}\Vert}\right)}^{\frac{2}{m-1}}}}.$$

Calculate the objective function, *J*_{m}.

Repeat steps 2–4 until *J*_{m} improves
by less than a specified minimum threshold or until after a specified
maximum number of iterations.