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

Skip to content

DOC remove color quantization K-means example #29961

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
Oct 14, 2024
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
3 changes: 3 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ def add_js_css_files(app, pagename, templatename, context, doctree):
"auto_examples/linear_model/plot_lasso_coordinate_descent_path.py": (
"auto_examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py"
),
"auto_examples/cluster/plot_color_quantization": (
"auto_examples/cluster/plot_face_compress"
),
}
html_context["redirects"] = redirects
for old_link in redirects:
Expand Down
17 changes: 11 additions & 6 deletions doc/datasets/loading_other_datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ and pipelines on 2D data.
load_sample_images
load_sample_image

.. image:: ../auto_examples/cluster/images/sphx_glr_plot_color_quantization_001.png
:target: ../auto_examples/cluster/plot_color_quantization.html
.. plot::
:context: close-figs
:scale: 30
:align: right
:include-source: False

import matplotlib.pyplot as plt
from sklearn.datasets import load_sample_image

china = load_sample_image("china.jpg")
plt.imshow(china)
plt.axis('off')
plt.tight_layout()
plt.show()

.. warning::

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

.. rubric:: Examples

* :ref:`sphx_glr_auto_examples_cluster_plot_color_quantization.py`

.. _libsvm_loader:

Datasets in svmlight / libsvm format
Expand Down
5 changes: 0 additions & 5 deletions doc/modules/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ computing cluster centers and values of inertia. For example, assigning a
weight of 2 to a sample is equivalent to adding a duplicate of that sample
to the dataset :math:`X`.

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

.. rubric:: Examples

* :ref:`sphx_glr_auto_examples_cluster_plot_cluster_iris.py`: Example usage of
Expand Down
93 changes: 0 additions & 93 deletions examples/cluster/plot_color_quantization.py

This file was deleted.

3 changes: 0 additions & 3 deletions sklearn/cluster/_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,9 +1362,6 @@ class KMeans(_BaseKMeans):
For examples of common problems with K-Means and how to address them see
:ref:`sphx_glr_auto_examples_cluster_plot_kmeans_assumptions.py`.

For an example of how to use K-Means to perform color quantization see
:ref:`sphx_glr_auto_examples_cluster_plot_color_quantization.py`.

For a demonstration of how K-Means can be used to cluster text documents see
:ref:`sphx_glr_auto_examples_text_plot_document_clustering.py`.

Expand Down
Loading