Skip to content

Commit

Permalink
minor tweak to within_cluster_sse
Browse files Browse the repository at this point in the history
  • Loading branch information
kbodwin committed Jul 26, 2022
1 parent ca58700 commit 5a22a4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/metric-sse.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ within_cluster_sse <- function(object, new_data = NULL,
.cluster = factor(paste0("Cluster_", .cluster))
) %>%
dplyr::group_by(.cluster) %>%
dplyr::summarize(wss = sum(dist))
dplyr::summarize(wss = sum(dist),
n_obs = n())
}

return(res)
Expand Down

0 comments on commit 5a22a4e

Please sign in to comment.