I'm trying to run K-means algorithm with predefined centroids. I have had a look at the following posts:
1.R k-means algorithm custom centers
2.Set static centers for kmeans in R
However, every time I run the command:
km = kmeans(df_std[,c(10:13)], centers = centroids)
I get the following error:
**Error: empty cluster: try a better set of initial centers**
I have defined the centroids as:
centroids = matrix(c(140.12774, 258.62615, 239.36800, 77.43235,
33.37736, 58.73077, 68.80000, 12.11765,
0.8937264, 0.8118462, 0.8380000, 0.8052941,
11.989858, 12.000000, 8.970000, 1.588235),
ncol = 4, byrow = T)
And my data, is a subset of a data frame say: df_std. It has been scaled already
df_std[,c(10:13)]
I'm wondering why would the system give the above error? Any help on this would be highly appreciated!