View source: R/kmeans_diagnostics.R
silhouettes | R Documentation |
Measures silhouettes between clusters
silhouettes(.data, clusters, distance = "euclidean")
.data |
A data frame |
clusters |
The column containing cluster assignments. |
distance |
The distance metric to use. (Currently only "euclidean") |
The silhouettes matrix.
kmeans_spec <- k_means(k = 5) %>% set_engine_celery("stats") kmeans_fit <- fit(kmeans_spec, ~., mtcars) mtcars %>% augment(kmeans_fit) %>% silhouettes(.cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.