From afee07b78952bc279b8a01098f865863fb002169 Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Tue, 1 Aug 2023 20:42:47 +0200 Subject: [PATCH 1/9] my first open source contribution --- examples/cluster/plot_optics.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/cluster/plot_optics.py b/examples/cluster/plot_optics.py index 5765f8089f3b2..b29ca795d0cbf 100644 --- a/examples/cluster/plot_optics.py +++ b/examples/cluster/plot_optics.py @@ -8,6 +8,10 @@ Finds core samples of high density and expands clusters from them. This example uses data that is generated so that the clusters have different densities. + +For an example of usage, see +:ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. + The :class:`~cluster.OPTICS` is first used with its Xi cluster detection method, and then setting specific thresholds on the reachability, which corresponds to :class:`~cluster.DBSCAN`. We can see that the different From b24b309fe19a55edce17aa51758685be5f3d3c5e Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Wed, 2 Aug 2023 19:21:00 +0200 Subject: [PATCH 2/9] updated into optics class --- examples/cluster/plot_optics.py | 3 --- sklearn/cluster/_optics.py | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/cluster/plot_optics.py b/examples/cluster/plot_optics.py index b29ca795d0cbf..523742d43f43d 100644 --- a/examples/cluster/plot_optics.py +++ b/examples/cluster/plot_optics.py @@ -9,9 +9,6 @@ This example uses data that is generated so that the clusters have different densities. -For an example of usage, see -:ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. - The :class:`~cluster.OPTICS` is first used with its Xi cluster detection method, and then setting specific thresholds on the reachability, which corresponds to :class:`~cluster.DBSCAN`. We can see that the different diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index 39d86be0c105a..434624ec9b817 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -53,6 +53,9 @@ class OPTICS(ClusterMixin, BaseEstimator): Read more in the :ref:`User Guide `. + For an example of usage, see + :ref:`sphx_glr_auto_examples_cluster_optics.py`. + Parameters ---------- min_samples : int > 1 or float between 0 and 1, default=5 From a1294fba5145ffd789126cb30a139f3c8fcc2110 Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Wed, 2 Aug 2023 21:56:30 +0200 Subject: [PATCH 3/9] updated link --- sklearn/cluster/_optics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index 434624ec9b817..9d06c00539658 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -54,7 +54,7 @@ class OPTICS(ClusterMixin, BaseEstimator): Read more in the :ref:`User Guide `. For an example of usage, see - :ref:`sphx_glr_auto_examples_cluster_optics.py`. + :ref:`sphx_glr_auto_examples_plot_cluster_optics.py`. Parameters ---------- From 834fbe8c4cb36e3b775964193d52fbb81bcc9869 Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Tue, 8 Aug 2023 18:08:21 +0200 Subject: [PATCH 4/9] updated according to the error messege --- sklearn/cluster/_optics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index 9d06c00539658..ccff422f6f6d3 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -54,7 +54,8 @@ class OPTICS(ClusterMixin, BaseEstimator): Read more in the :ref:`User Guide `. For an example of usage, see - :ref:`sphx_glr_auto_examples_plot_cluster_optics.py`. + :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. + Parameters ---------- From c4b3e2bc3191d52509ea3c533e61371d8b90bd58 Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Wed, 9 Aug 2023 10:24:19 +0200 Subject: [PATCH 5/9] updated location of the example at the end of docstring --- sklearn/cluster/_optics.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index ccff422f6f6d3..926e45121e0fb 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -51,12 +51,7 @@ class OPTICS(ClusterMixin, BaseEstimator): cluster order. Note that we do not employ a heap to manage the expansion candidates, so the time complexity will be O(n^2). - Read more in the :ref:`User Guide `. - - For an example of usage, see - :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. - - + Read more in the :ref:`User Guide `. Parameters ---------- min_samples : int > 1 or float between 0 and 1, default=5 @@ -237,6 +232,8 @@ class OPTICS(ClusterMixin, BaseEstimator): >>> clustering = OPTICS(min_samples=2).fit(X) >>> clustering.labels_ array([0, 0, 0, 1, 1, 1]) + + For an example of usage, see :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. """ _parameter_constraints: dict = { From 00062c95023e515e68f93b7d6b7530146dfde90e Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Wed, 9 Aug 2023 11:00:38 +0200 Subject: [PATCH 6/9] reduced whitespace --- sklearn/cluster/_optics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index 926e45121e0fb..7c309b65a8f8d 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -50,9 +50,9 @@ class OPTICS(ClusterMixin, BaseEstimator): computing only the distances to unprocessed points when constructing the cluster order. Note that we do not employ a heap to manage the expansion candidates, so the time complexity will be O(n^2). - - Read more in the :ref:`User Guide `. - Parameters + Read more in the :ref:`User Guide `. + + Parameters ---------- min_samples : int > 1 or float between 0 and 1, default=5 The number of samples in a neighborhood for a point to be considered as From eae28f447a81cd75c79a61875022c9f12350cbe3 Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Wed, 9 Aug 2023 11:28:25 +0200 Subject: [PATCH 7/9] Update sklearn/cluster/_optics.py --- sklearn/cluster/_optics.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index 7c309b65a8f8d..d1cd6e70af688 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -50,9 +50,10 @@ class OPTICS(ClusterMixin, BaseEstimator): computing only the distances to unprocessed points when constructing the cluster order. Note that we do not employ a heap to manage the expansion candidates, so the time complexity will be O(n^2). + Read more in the :ref:`User Guide `. - - Parameters + + Parameters ---------- min_samples : int > 1 or float between 0 and 1, default=5 The number of samples in a neighborhood for a point to be considered as @@ -233,7 +234,8 @@ class OPTICS(ClusterMixin, BaseEstimator): >>> clustering.labels_ array([0, 0, 0, 1, 1, 1]) - For an example of usage, see :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. + For an example of usage, see + :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. """ _parameter_constraints: dict = { From 5440671482e509134a1d9b5e736d92f651e4f003 Mon Sep 17 00:00:00 2001 From: tanjina-hub Date: Wed, 9 Aug 2023 11:53:54 +0200 Subject: [PATCH 8/9] Update sklearn/cluster/_optics.py --- sklearn/cluster/_optics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index d1cd6e70af688..b7938aac18f9d 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -234,7 +234,7 @@ class OPTICS(ClusterMixin, BaseEstimator): >>> clustering.labels_ array([0, 0, 0, 1, 1, 1]) - For an example of usage, see + For an example of usage, see :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. """ From b7a079ba89b67fd584ba09e66c501b38f6ab314b Mon Sep 17 00:00:00 2001 From: Adrin Jalali Date: Tue, 15 Aug 2023 16:40:12 +0200 Subject: [PATCH 9/9] Update sklearn/cluster/_optics.py --- sklearn/cluster/_optics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index b7938aac18f9d..c1665b28d0060 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -234,7 +234,7 @@ class OPTICS(ClusterMixin, BaseEstimator): >>> clustering.labels_ array([0, 0, 0, 1, 1, 1]) - For an example of usage, see + For a more detailed example see :ref:`sphx_glr_auto_examples_cluster_plot_optics.py`. """