diff --git a/examples/cluster/plot_kmeans_digits.py b/examples/cluster/plot_kmeans_digits.py index fc79c867a8589..94bba2a5c52d9 100644 --- a/examples/cluster/plot_kmeans_digits.py +++ b/examples/cluster/plot_kmeans_digits.py @@ -114,7 +114,7 @@ def bench_k_means(kmeans, name, data, labels): # # We will compare three approaches: # -# * an initialization using `kmeans++`. This method is stochastic and we will +# * an initialization using `k-means++`. This method is stochastic and we will # run the initialization 4 times; # * a random initialization. This method is stochastic as well and we will run # the initialization 4 times; diff --git a/examples/cluster/plot_kmeans_plusplus.py b/examples/cluster/plot_kmeans_plusplus.py index eea2c2ec85093..1f3507c0062ac 100644 --- a/examples/cluster/plot_kmeans_plusplus.py +++ b/examples/cluster/plot_kmeans_plusplus.py @@ -23,7 +23,7 @@ ) X = X[:, ::-1] -# Calculate seeds from kmeans++ +# Calculate seeds from k-means++ centers_init, indices = kmeans_plusplus(X, n_clusters=4, random_state=0) # Plot init seeds along side sample data diff --git a/examples/cluster/plot_kmeans_stability_low_dim_dense.py b/examples/cluster/plot_kmeans_stability_low_dim_dense.py index 774be277037c7..c88cf864506f7 100644 --- a/examples/cluster/plot_kmeans_stability_low_dim_dense.py +++ b/examples/cluster/plot_kmeans_stability_low_dim_dense.py @@ -10,7 +10,7 @@ The first plot shows the best inertia reached for each combination of the model (``KMeans`` or ``MiniBatchKMeans``), and the init method -(``init="random"`` or ``init="kmeans++"``) for increasing values of the +(``init="random"`` or ``init="k-means++"``) for increasing values of the ``n_init`` parameter that controls the number of initializations. The second plot demonstrates one single run of the ``MiniBatchKMeans`` diff --git a/sklearn/cluster/_kmeans.py b/sklearn/cluster/_kmeans.py index dda68155b47f6..11d2b81cd552f 100644 --- a/sklearn/cluster/_kmeans.py +++ b/sklearn/cluster/_kmeans.py @@ -345,7 +345,7 @@ def k_means( n_init consecutive runs in terms of inertia. When `n_init='auto'`, the number of runs depends on the value of init: - 10 if using `init='random'`, 1 if using `init='kmeans++'`. + 10 if using `init='random'`, 1 if using `init='k-means++'`. .. versionadded:: 1.2 Added 'auto' option for `n_init`. @@ -1206,7 +1206,7 @@ class KMeans(_BaseKMeans): high-dimensional problems (see :ref:`kmeans_sparse_high_dim`). When `n_init='auto'`, the number of runs depends on the value of init: - 10 if using `init='random'`, 1 if using `init='kmeans++'`. + 10 if using `init='random'`, 1 if using `init='k-means++'`. .. versionadded:: 1.2 Added 'auto' option for `n_init`. @@ -1734,7 +1734,7 @@ class MiniBatchKMeans(_BaseKMeans): :ref:`kmeans_sparse_high_dim`). When `n_init='auto'`, the number of runs depends on the value of init: - 3 if using `init='random'`, 1 if using `init='kmeans++'`. + 3 if using `init='random'`, 1 if using `init='k-means++'`. .. versionadded:: 1.2 Added 'auto' option for `n_init`.