| cluster_pam | R Documentation |
Clustering around representative data points (medoids) using cluster::pam.
cluster_pam(k = 1)
k |
the number of clusters to generate. |
More robust to outliers than k‑means. The intrinsic metric reported is the within‑cluster SSE to medoids.
returns PAM object.
Kaufman, L. and Rousseeuw, P. J. (1990). Finding Groups in Data: An Introduction to Cluster Analysis.
# setup clustering
model <- cluster_pam(k = 3)
#load dataset
data(iris)
# build model
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)
# evaluate model using external metric
eval <- evaluate(model, clu, iris$Species)
eval
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.