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

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -