Skip to main content

Module k_means

Module k_means 

Source
Expand description

k-means clustering.

See the book entry k-means and k-medoids.

Structs§

KMeans
Lloyd’s k-means with k-means++ seeding: alternately assign each point to its nearest centroid and move each centroid to the mean of its points, minimising the within-cluster sum of squared distances (the inertia). The run is repeated n_init times from different seedings and the lowest-inertia result kept, because the algorithm only finds a local optimum. A cluster that loses all its points is re-seeded at the point farthest from its centroid.