init.centers {CEC} | R Documentation |
Creates a matrix of k
points (centers) based on a given matrix of points.
One of two method can be used: Kmeans++ centers initialization method or a random choice of data points.
init.centers(x, k, method = c("kmeans++", "random"))
x |
Dataset as a matrix of n-dimensional points. |
k |
Number of points (centers) to generate. |
method |
Generation method. Possible values are: "kmeans++", "random.points". |
Matrix points (centers) with k
rows.
m = matrix(runif(3000), 1000, 3) init.centers(m, 3, method = "km")