powered by
Compute the total sum of squares
sse_total(object, ...)# S3 method for cluster_spec sse_total(object, ...)# S3 method for cluster_fit sse_total(object, new_data = NULL, dist_fun = NULL, ...)# S3 method for workflow sse_total(object, new_data = NULL, dist_fun = NULL, ...)sse_total_vec( object, new_data = NULL, dist_fun = function(x, y) { philentropy::dist_many_many(x, y, method = "euclidean") }, ... )
# S3 method for cluster_spec sse_total(object, ...)
# S3 method for cluster_fit sse_total(object, new_data = NULL, dist_fun = NULL, ...)
# S3 method for workflow sse_total(object, new_data = NULL, dist_fun = NULL, ...)
sse_total_vec( object, new_data = NULL, dist_fun = function(x, y) { philentropy::dist_many_many(x, y, method = "euclidean") }, ... )
A tibble with 3 columns; .metric, .estimator, and .estimate.
.metric
.estimator
.estimate
A fitted kmeans tidyclust model
Other arguments passed to methods.
A dataset to predict on. If NULL, uses trained clustering.
NULL
A function for calculating distances to centroids. Defaults to Euclidean distance on processed data.
Other cluster metric: silhouette_avg(), sse_ratio(), sse_within_total()
silhouette_avg()
sse_ratio()
sse_within_total()
kmeans_spec <- k_means(num_clusters = 5) %>% set_engine("stats") kmeans_fit <- fit(kmeans_spec, ~., mtcars) sse_total(kmeans_fit) sse_total_vec(kmeans_fit)
Run the code above in your browser using DataLab