Skip to content

DOC Fix typo in parameter description of KMeans #25649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/cluster/plot_kmeans_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_kmeans_plusplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_kmeans_stability_low_dim_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
6 changes: 3 additions & 3 deletions sklearn/cluster/_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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`.
Expand Down