Skip to content

DOC Update docs for KMeans #25546

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 4 commits into from
Feb 7, 2023
Merged
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
12 changes: 6 additions & 6 deletions sklearn/cluster/_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ def k_means(
centroid seeds. The final results will be the best output of
n_init consecutive runs in terms of inertia.

When `n_init='auto'`, the number of runs will be 10 if using
`init='random'`, and 1 if using `init='kmeans++'`.
When `n_init='auto'`, the number of runs depends on the value of init:
10 if using `init='random'`, 1 if using `init='kmeans++'`.

.. versionadded:: 1.2
Added 'auto' option for `n_init`.
Expand Down Expand Up @@ -1208,8 +1208,8 @@ class KMeans(_BaseKMeans):
in terms of inertia. Several runs are recommended for sparse
high-dimensional problems (see :ref:`kmeans_sparse_high_dim`).

When `n_init='auto'`, the number of runs will be 10 if using
`init='random'`, and 1 if using `init='kmeans++'`.
When `n_init='auto'`, the number of runs depends on the value of init:
10 if using `init='random'`, 1 if using `init='kmeans++'`.

.. versionadded:: 1.2
Added 'auto' option for `n_init`.
Expand Down Expand Up @@ -1736,8 +1736,8 @@ class MiniBatchKMeans(_BaseKMeans):
recommended for sparse high-dimensional problems (see
:ref:`kmeans_sparse_high_dim`).

When `n_init='auto'`, the number of runs will be 3 if using
`init='random'`, and 1 if using `init='kmeans++'`.
When `n_init='auto'`, the number of runs depends on the value of init:
3 if using `init='random'`, 1 if using `init='kmeans++'`.

.. versionadded:: 1.2
Added 'auto' option for `n_init`.
Expand Down