if (FALSE) {
model = cluster::pam(iris[-5], 3L)
sil = cluster::silhouette(model)
autoplot(sil)
autoplot(cluster::silhouette(cluster::clara(iris[-5], 3)))
autoplot(cluster::silhouette(cluster::fanny(iris[-5], 3)))
model = stats::kmeans(iris[-5], 3)
sil = cluster::silhouette(model$cluster, stats::dist(iris[-5]))
autoplot(sil)
}
Run the code above in your browser using DataLab