compute_wcss | R Documentation |
Given a vector of cluster labels, a matrix of centroids, and a dataset, it computes the WCSS.
compute_wcss(clusters, cent, data)
clusters |
numeric vector with the cluster assignments. |
cent |
numeric matrix with the centroids (clusters in rows, variables in columns). |
data |
matrix-like object containing the data (numeric or integer). |
A numeric vector with the value of WCSS per cluster.
data = matrix(1:30,nrow = 10) cl <- mini_batch(data, 2, 10, 10) compute_wcss(cl$Clusters, cl$centroids, data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.