Learn R Programming

daltoolbox (version 1.3.767)

cluster_cmeans: Fuzzy c-means

Description

Fuzzy c-means clustering using e1071::cmeans.

Usage

cluster_cmeans(centers = 2, m = 2, iter = 100, dist = "euclidean")

Value

returns a fuzzy clustering object.

Arguments

centers

number of clusters

m

fuzziness parameter (m > 1)

iter

maximum number of iterations

dist

distance method passed to e1071::cmeans

Details

Produces soft membership for each cluster. The hard assignment is returned by cluster(). Membership degrees are returned in the membership attribute.

The base clusterer() uses wcss as a generic default, but cluster_cmeans() specializes that choice because fuzzy clustering carries both a hard partition view and a soft membership structure.

Default evaluation in cluster_cmeans() is:

  • main metric: metric_silhouette()

  • internal evaluation: silhouette, withinerror

  • external evaluation: entropy, purity, adjusted_rand_index

The generic wcss fallback is not used as the main metric because fuzzy c-means is better summarized by a partition quality index plus a criterion that respects the model's own within-cluster objective.

References

Bezdek, J. C. (1981). Pattern Recognition with Fuzzy Objective Function Algorithms. Rousseeuw, P. J. (1987). Silhouettes: A graphical aid to the interpretation and validation of cluster analysis.

Examples

Run this code
data(iris)
model <- cluster_cmeans(centers = 3, m = 2)
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)

Run the code above in your browser using DataLab