Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC Add links to example plot_kmeans_stability_low_dim_dense.py #30349

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
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
7 changes: 4 additions & 3 deletions doc/modules/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,10 @@ initializations of the centroids. One method to help address this issue is the
k-means++ initialization scheme, which has been implemented in scikit-learn
(use the ``init='k-means++'`` parameter). This initializes the centroids to be
(generally) distant from each other, leading to probably better results than
random initialization, as shown in the reference. For a detailed example of
comaparing different initialization schemes, refer to
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_digits.py`.
random initialization, as shown in the reference. For detailed examples of
comparing different initialization schemes, refer to
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_digits.py` and
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_stability_low_dim_dense.py`.

K-means++ can also be called independently to select seeds for other
clustering algorithms, see :func:`sklearn.cluster.kmeans_plusplus` for details
Expand Down
10 changes: 8 additions & 2 deletions sklearn/cluster/_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,11 @@ class KMeans(_BaseKMeans):
* If a callable is passed, it should take arguments X, n_clusters and a\
random state and return an initialization.

For an example of how to use the different `init` strategy, see the example
entitled :ref:`sphx_glr_auto_examples_cluster_plot_kmeans_digits.py`.
For an example of how to use the different `init` strategies, see
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_digits.py`.

For an evaluation of the impact of initialization, see the example
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_stability_low_dim_dense.py`.

n_init : 'auto' or int, default='auto'
Number of times the k-means algorithm is run with different centroid
Expand Down Expand Up @@ -1700,6 +1703,9 @@ class MiniBatchKMeans(_BaseKMeans):
If a callable is passed, it should take arguments X, n_clusters and a
random state and return an initialization.

For an evaluation of the impact of initialization, see the example
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_stability_low_dim_dense.py`.

max_iter : int, default=100
Maximum number of iterations over the complete dataset before
stopping independently of any early stopping criterion heuristics.
Expand Down