liveBook · Manning

Fuzzy c-means clustering

As explained in Data Without Labels

Fuzzy c-means clustering is a fuzzy clustering algorithm that assigns observations degrees of membership across multiple clusters by iteratively updating memberships and cluster centers.

Fuzzy c-means (FCM) groups observations while preserving partial membership. A customer transaction, for example, can belong to several clusters to different degrees rather than receiving one absolute label. section 5.5.1

FCM resembles k-means but assigns each point a membership grade for every cluster. Grades range from 0 to 1, indicate degree of belonging, and should not be interpreted as probabilities or assumed to sum to 1. section 5.5.1

A practical FCM workflow includes:

  • Prepare the data points and choose candidate numbers of clusters. section 5.5.2
  • Set cluster centers, weights, a random seed, an error tolerance, and a maximum iteration count. section 5.5.2
  • Run `fuzz.cluster.cmeans`, collect membership values and centers, and compare the resulting configurations using the fuzzy partition coefficient (FPC). section 5.5.2
  • Plot points and mark centers, using the strongest membership with `argmax` for a readable assigned-cluster view. section 5.5.2

Synthetic two-dimensional data

Generate 500-point groups from specified centers and standard deviations, then evaluate FCM with different cluster counts. Plot each configuration, mark its learned centers, and display its FPC to compare outputs. section 5.5.2

Figure 5.17 Data points that can be clustered (left). The data points can be grouped into two clusters. For the first cluster, the cluster centroid is represented using a + sign (middle). Point 1 is much closer to the cluster center as compared to point 2. So we can conclude that point 1 belongs to this cluster to a higher degree than cluster 2.
figure

Use the diagram to see how distance from a centroid changes a point's membership degree: a nearer point belongs more strongly than a boundary point. section 5.5.1

How Data Without Labels covers it

How deep it goes
Explains membership grades, centroid distance, iterative settings, Python execution, plots, and FPC, but does not detail the full mathematical derivation.
Examples
Demonstrates synthetic two-dimensional points, varied cluster counts, plotted centroids, membership-based assignments, and FPC values.
What you can do after
Apply it via skfuzzy, visualize alternative clusterings, inspect centroids, and compare configurations with FPC.
How it connects
Connects fuzzy clustering with k-means clustering, soft clustering, and Gaussian mixture models.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.