From 4f5ce4252a007a6b98ddff6feff069cb43d29a0e Mon Sep 17 00:00:00 2001 From: John Enblom <87203595+J-Enblom@users.noreply.github.com> Date: Thu, 9 May 2024 14:37:36 +0200 Subject: [PATCH 1/2] ref link for plot_nearest_centroid.py added --- sklearn/neighbors/_nearest_centroid.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sklearn/neighbors/_nearest_centroid.py b/sklearn/neighbors/_nearest_centroid.py index c9c99aeeaadb2..49085627aef8a 100644 --- a/sklearn/neighbors/_nearest_centroid.py +++ b/sklearn/neighbors/_nearest_centroid.py @@ -29,6 +29,9 @@ class NearestCentroid(ClassifierMixin, BaseEstimator): Read more in the :ref:`User Guide `. + For sample usage of NearestCentroid, refer to + :ref:`sphx_glr_auto_examples_neighbors_plot_nearest_centroid.py` + Parameters ---------- metric : {"euclidean", "manhattan"}, default="euclidean" From 0f369901ace56106ccec609a80d055083c2dfa3e Mon Sep 17 00:00:00 2001 From: John Enblom <87203595+J-Enblom@users.noreply.github.com> Date: Mon, 13 May 2024 12:59:22 +0200 Subject: [PATCH 2/2] Moved and updated comment --- sklearn/neighbors/_nearest_centroid.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sklearn/neighbors/_nearest_centroid.py b/sklearn/neighbors/_nearest_centroid.py index 49085627aef8a..d63fb8fcd2937 100644 --- a/sklearn/neighbors/_nearest_centroid.py +++ b/sklearn/neighbors/_nearest_centroid.py @@ -29,9 +29,6 @@ class NearestCentroid(ClassifierMixin, BaseEstimator): Read more in the :ref:`User Guide `. - For sample usage of NearestCentroid, refer to - :ref:`sphx_glr_auto_examples_neighbors_plot_nearest_centroid.py` - Parameters ---------- metric : {"euclidean", "manhattan"}, default="euclidean" @@ -98,6 +95,9 @@ class is the arithmetic mean, which minimizes the sum of squared L1 distances. NearestCentroid() >>> print(clf.predict([[-0.8, -1]])) [1] + + For a more detailed example see: + :ref:`sphx_glr_auto_examples_neighbors_plot_nearest_centroid.py` """ _parameter_constraints: dict = {