Description Usage Arguments Value See Also Examples
Generates a K-means clustering of a given feature matrix, with K cluster centers. K-means is a common non-probabilistic clustering method, useful when data can be fit to circular clusters.
1 | KMEANS(data_matrix, K)
|
data_matrix |
An N x M matrix, containing N rows (observations) and M columns (data features) |
K |
A positive integer describing the number of clusters the clustering should produce. |
A list containing the following results:
|
a vector of length N containing the cluster ids of each observation. Cluster ids are positive integers from 1:K inclusive. |
|
a matrix of cluster centers, with K rows, and M columns. |
|
a vector of length K, containing within-cluster sums of squares for each cluster. |
|
the total within-cluster sum of squares |
|
a vector of length K, containing the number of points in each cluster. |
stats::kmeans for a more robust implementation.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.