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

Skip to content

Commit 48ef3ba

Browse files
authored
DOC remove color quantization K-means example (#29961)
1 parent fc5428b commit 48ef3ba

File tree

5 files changed

+14
-107
lines changed

5 files changed

+14
-107
lines changed

doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ def add_js_css_files(app, pagename, templatename, context, doctree):
478478
"auto_examples/linear_model/plot_lasso_coordinate_descent_path": (
479479
"auto_examples/linear_model/plot_lasso_lasso_lars_elasticnet_path"
480480
),
481+
"auto_examples/cluster/plot_color_quantization": (
482+
"auto_examples/cluster/plot_face_compress"
483+
),
481484
}
482485
html_context["redirects"] = redirects
483486
for old_link in redirects:

doc/datasets/loading_other_datasets.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ and pipelines on 2D data.
1919
load_sample_images
2020
load_sample_image
2121

22-
.. image:: ../auto_examples/cluster/images/sphx_glr_plot_color_quantization_001.png
23-
:target: ../auto_examples/cluster/plot_color_quantization.html
22+
.. plot::
23+
:context: close-figs
2424
:scale: 30
2525
:align: right
26+
:include-source: False
2627

28+
import matplotlib.pyplot as plt
29+
from sklearn.datasets import load_sample_image
30+
31+
china = load_sample_image("china.jpg")
32+
plt.imshow(china)
33+
plt.axis('off')
34+
plt.tight_layout()
35+
plt.show()
2736

2837
.. warning::
2938

@@ -33,10 +42,6 @@ and pipelines on 2D data.
3342
if you plan to use ``matplotlib.pyplpt.imshow``, don't forget to scale to the range
3443
0 - 1 as done in the following example.
3544

36-
.. rubric:: Examples
37-
38-
* :ref:`sphx_glr_auto_examples_cluster_plot_color_quantization.py`
39-
4045
.. _libsvm_loader:
4146

4247
Datasets in svmlight / libsvm format

doc/modules/clustering.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,6 @@ computing cluster centers and values of inertia. For example, assigning a
236236
weight of 2 to a sample is equivalent to adding a duplicate of that sample
237237
to the dataset :math:`X`.
238238

239-
K-means can be used for vector quantization. This is achieved using the
240-
``transform`` method of a trained model of :class:`KMeans`. For an example of
241-
performing vector quantization on an image refer to
242-
:ref:`sphx_glr_auto_examples_cluster_plot_color_quantization.py`.
243-
244239
.. rubric:: Examples
245240

246241
* :ref:`sphx_glr_auto_examples_cluster_plot_cluster_iris.py`: Example usage of

examples/cluster/plot_color_quantization.py

Lines changed: 0 additions & 93 deletions
This file was deleted.

sklearn/cluster/_kmeans.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,9 +1363,6 @@ class KMeans(_BaseKMeans):
13631363
For examples of common problems with K-Means and how to address them see
13641364
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_assumptions.py`.
13651365
1366-
For an example of how to use K-Means to perform color quantization see
1367-
:ref:`sphx_glr_auto_examples_cluster_plot_color_quantization.py`.
1368-
13691366
For a demonstration of how K-Means can be used to cluster text documents see
13701367
:ref:`sphx_glr_auto_examples_text_plot_document_clustering.py`.
13711368

0 commit comments

Comments
 (0)