Chooses initial cluster locations using Kmeans++

init_centers(X, k)

Arguments

X

array Data points of dimension (n,d)

k

int The number of desired clusters

Value

array Initial coordinates of clusters

Examples

X = rbind(c(0,0), c(1,1)) init_centers(X, 2)
#> [,1] [,2] #> [1,] 1 1 #> [2,] 0 0