@@ -1224,22 +1224,25 @@ class KMeans(_BaseKMeans):
1224
1224
(n_clusters, n_features), default='k-means++'
1225
1225
Method for initialization:
1226
1226
1227
- 'k-means++' : selects initial cluster centroids using sampling based on
1228
- an empirical probability distribution of the points' contribution to the
1229
- overall inertia. This technique speeds up convergence. The algorithm
1230
- implemented is "greedy k-means++". It differs from the vanilla k-means++
1231
- by making several trials at each sampling step and choosing the best centroid
1232
- among them.
1227
+ * 'k-means++' : selects initial cluster centroids using sampling \
1228
+ based on an empirical probability distribution of the points' \
1229
+ contribution to the overall inertia. This technique speeds up \
1230
+ convergence. The algorithm implemented is "greedy k-means++". It \
1231
+ differs from the vanilla k-means++ by making several trials at \
1232
+ each sampling step and choosing the best centroid among them.
1233
1233
1234
- 'random': choose `n_clusters` observations (rows) at random from data
1235
- for the initial centroids.
1234
+ * 'random': choose `n_clusters` observations (rows) at random from \
1235
+ data for the initial centroids.
1236
1236
1237
- If an array is passed, it should be of shape (n_clusters, n_features)
1237
+ * If an array is passed, it should be of shape (n_clusters, n_features)\
1238
1238
and gives the initial centers.
1239
1239
1240
- If a callable is passed, it should take arguments X, n_clusters and a
1240
+ * If a callable is passed, it should take arguments X, n_clusters and a\
1241
1241
random state and return an initialization.
1242
1242
1243
+ For an example of how to use the different `init` strategy, see the example
1244
+ entitled :ref:`sphx_glr_auto_examples_cluster_plot_kmeans_digits.py`.
1245
+
1243
1246
n_init : 'auto' or int, default=10
1244
1247
Number of times the k-means algorithm is run with different centroid
1245
1248
seeds. The final results is the best output of `n_init` consecutive runs
0 commit comments