avg_silhouette: Measures average silhouette between clusters

View source: R/kmeans_diagnostics.R

avg_silhouetteR Documentation

Measures average silhouette between clusters

Description

Measures average silhouette between clusters

Usage

avg_silhouette(.data, clusters, distance = "euclidean")

Arguments

.data

A data frame

clusters

The column containing cluster assignments.

distance

The distance metric to use. (Currently only "euclidean")

Value

The average of all cluster silhouettes.

Examples

kmeans_spec <- k_means(k = 5) %>%
  set_engine_celery("stats")

kmeans_fit <- fit(kmeans_spec, ~., mtcars)

mtcars %>%
  augment(kmeans_fit) %>%
  silhouettes(.cluster)


kbodwin/celery documentation built on March 26, 2022, 12:33 a.m.