| cluster_cmeans | R Documentation |
Fuzzy c-means clustering.
cluster_cmeans(
centers = 2,
m = 2,
iter = 100,
dist = "euclidean",
tol = 1e-06,
nstart = 1,
seed = NULL
)
centers |
number of clusters |
m |
fuzziness parameter (m > 1) |
iter |
maximum number of iterations |
dist |
distance method: "euclidean" or "manhattan" |
tol |
convergence tolerance on the membership change |
nstart |
number of restarts; the lowest-error run is kept (default 1) |
seed |
optional seed for reproducibility |
Produces soft membership for each cluster. The hard assignment is returned by cluster().
Membership degrees are returned in the membership attribute. The algorithm alternates
between updating cluster centers as membership-weighted means and recomputing memberships
from the distances to those centers, until convergence. With nstart > 1 it runs several
times from different random starts and keeps the run with the lowest within-cluster fuzzy
error, reducing sensitivity to the random start.
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.
returns a fuzzy clustering object.
Bezdek, J. C. (1981). Pattern Recognition with Fuzzy Objective Function Algorithms. Dunn, J. C. (1973). A Fuzzy Relative of the ISODATA Process and Its Use in Detecting Compact Well-Separated Clusters. Rousseeuw, P. J. (1987). Silhouettes: A graphical aid to the interpretation and validation of cluster analysis.
data(iris)
model <- cluster_cmeans(centers = 3, m = 2)
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.