KMEANS_Euc | R Documentation |
KMEANS_Euc function
KMEANS_Euc(X, K, M = NULL, numIter = 100)
X |
An n x p matrix of data points |
K |
Number of clusters given as an integer |
M |
Initial K x p matrix of cluster centers |
numIter |
maximal number of iterations for the algorithm |
Returns a vector of length n of cluster assignments
X = matrix(c(1, 2, 3, 0, 1, 2, 9, 10, 11, 10, 11, 12), nrow = 4, ncol = 3, byrow = TRUE) K = 2 KMEANS_Euc(X=X,K=K,M=NULL,numIter = 100) ## returns a column matrix: [0, 0, 1, 1]' or [1, 1, 0, 0]'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.