python - How does sklearn.cluster.KMeans handle an init ndarray parameter with missing centroids (available centroids less than n_clusters)? -


in python sklearn kmeans (see documentation), wondering happens internally when passing ndarray of shape (n, n_features) init parameter, when n<n_clusters

  1. does drop given centroids , starts kmeans++ initialization default choice init parameter ? (pdf paper kmeans++) (how kmeans++ work)
  2. does consider given centroids , fill accordingly remaining centroids using kmeans++ ?
  3. does consider given centroids , fill remaining centroids using random values ?

i didn't expect method returns no warning in case. that's why need know how manages this.

if give mismatching init adjust number of clusters, can see source. not documented , consider bug. i'll propose fix it.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -