66 C-Means (Fuzzy) Clustering
K-means makes a hard choice for every observation: each farm belongs to exactly one cluster, full stop, even if its features sit almost exactly halfway between two group centers. Fuzzy c-means (J. C. Dunn, 1973) relaxes that requirement. Instead of a single cluster label, every observation gets a membership degree for each cluster, a number between 0 and 1 indicating how strongly it belongs there, with the memberships for one observation summing to 1 across all clusters. A farm might belong 0.85 to the “medium mixed” cluster and 0.15 to the “large intensive” cluster rather than being forced entirely into one or the other, and that partial membership is often a more honest description of a farm sitting near a genuine transition zone rather than an error the algorithm should be penalized for.
66.1 Hard vs Soft Clustering
The distinction between hard and soft clustering matters beyond clustering theory. A cooperative deciding which farms to prioritize for an irrigation-expansion subsidy might reasonably want to know not just which cluster a borderline farm was assigned to, but how confidently it was assigned there. A membership of 0.98 in one cluster is a very different situation from a near-even 0.52/0.48 split, even if a hard clustering method would report both farms identically as belonging to “cluster 1.” Fuzzy methods keep that distinction visible instead of discarding it at the moment of assignment.
66.2 Worked Example
The same eighteen farms used for k-means, described by farm size, irrigation share, and fertilizer spending per acre.
| Farm | Size (acres) | Irrigation (%) | Fertilizer Spend (₹’000/acre) |
|---|---|---|---|
| 1 | 2.5 | 10 | 3.5 |
| 2 | 3.0 | 15 | 4.0 |
| 3 | 3.5 | 8 | 5.0 |
| 4 | 4.0 | 20 | 4.5 |
| 5 | 2.8 | 12 | 3.8 |
| 6 | 4.5 | 22 | 6.0 |
| 7 | 6.5 | 40 | 9.5 |
| 8 | 7.0 | 45 | 10.0 |
| 9 | 8.0 | 38 | 11.0 |
| 10 | 7.5 | 50 | 9.8 |
| 11 | 9.0 | 42 | 12.5 |
| 12 | 8.5 | 55 | 11.5 |
| 13 | 12.0 | 70 | 16.0 |
| 14 | 14.0 | 75 | 18.0 |
| 15 | 11.5 | 68 | 15.5 |
| 16 | 16.0 | 85 | 20.0 |
| 17 | 13.0 | 72 | 17.0 |
| 18 | 15.5 | 90 | 21.0 |
66.3 C-Means Clustering in R
cluster, like MASS and rpart, is one of R’s recommended packages bundled with every standard installation. Its fanny() function performs fuzzy analysis clustering, a soft-partitioning method in the same family as classic fuzzy c-means, producing exactly the membership-degree output this section needs without depending on a package outside R’s base and recommended set.
66.4 Reading the Result
Most of the eighteen farms should show one dominant membership degree, well above the other two, since the three groups in this data are reasonably well separated to begin with. The interesting cases are whichever farms do not: a farm sitting between “medium mixed” and “large intensive,” for instance, with membership something like 0.55 and 0.40, is telling the extension office something a hard k-means label would have hidden entirely, that this farm does not cleanly fit either category and might need individualized attention rather than a generic group-based recommendation. The partition coefficient printed at the end summarizes this at the dataset level: a value close to 1 indicates the clustering is nearly as crisp as a hard partition would be, while a value closer to \(1/k\) (here, close to 0.33) indicates the boundaries between clusters are genuinely fuzzy across much of the data.
Summary
| Concept | Description |
|---|---|
| Foundations | |
| Fuzzy C-Means Clustering | Assigns every observation a degree of membership in each cluster rather than a single hard label |
| Membership Degrees | A number between 0 and 1 per cluster per observation, summing to 1, reflecting partial or shared belonging |
| Hard vs Soft Clustering | K-means forces one cluster per observation; fuzzy methods report how strongly it belongs to each |
| Why Soft Assignment Matters in Practice | A borderline farm's partial memberships surface transition cases a hard clustering method would hide |
| Worked Example | |
| Worked Example: The Same Eighteen Farms | The same eighteen farms clustered by size, irrigation share, and fertilizer spend as in the previous section |
| Fitting with fanny() from the cluster Package | fanny() from R's recommended cluster package performs fuzzy analysis clustering with no extra dependencies |
| Identifying Borderline Farms | Farms with no membership degree above roughly 0.60 sit genuinely between two clusters |
| The Partition Coefficient | Summarizes overall fuzziness: near 1 means crisp clusters, near 1/k means poorly separated groups |