Finds k clusters in data points and assigns each point to a cluster.

fit_assign(X, k)

Arguments

X

array: Data points of dimension (n,d)

k

int: The number of desired clusters

Value

list: array of cluster centers dimension(n,d), array of cluster labels dimension (n,1)

Examples

X = rbind(c(0,0), c(1,1)) km <- fit_assign(X, 2)