sse_within | R Documentation |
Calculates Sum of Squared Error in each cluster
sse_within(object, new_data = NULL, dist_fun = Rfast::dista)
object |
A fitted kmeans tidyclust model |
new_data |
A dataset to predict on. If |
dist_fun |
A function for calculating distances to centroids. Defaults to Euclidean distance on processed data. |
sse_within_total()
is the corresponding cluster metric function
that returns the sum of the values given by sse_within()
.
A tibble with two columns, the cluster name and the SSE within that cluster.
kmeans_spec <- k_means(num_clusters = 5) %>%
set_engine("stats")
kmeans_fit <- fit(kmeans_spec, ~., mtcars)
sse_within(kmeans_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.