powered by
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.
k
init.centers(x, k, method = c("kmeans++", "random"))
Dataset as a matrix of n-dimensional points.
Number of points (centers) to generate.
Generation method. Possible values are: "kmeans++", "random.points".
Matrix points (centers) with k rows.
# NOT RUN { m = matrix(runif(3000), 1000, 3) init.centers(m, 3, method = "km") # }
Run the code above in your browser using DataLab