From aa1f736327ef1edb9ee1f94c0468832a0c839577 Mon Sep 17 00:00:00 2001 From: "@davidcherney" Date: Sun, 25 Aug 2024 14:17:52 -0600 Subject: [PATCH 1/6] added See Also section to mds DOC string --- sklearn/manifold/_mds.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index bb43bb0c73722..be2787b595aca 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -90,6 +90,20 @@ def _smacof_single( n_iter : int The number of iterations corresponding to the best stress. + See Also + -------- + sklearn.decomposition.PCA : Principal component analysis that is a linear + dimensionality reduction method. + sklearn.decomposition.KernelPCA : Non-linear dimensionality reduction using + kernels and PCA. + Isomap : Non-linear dimensionality reduction through Isometric Mapping. + TSNE : T-distributed Stochastic Neighbor Embedding. + LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding. + SpectralEmbedding : Spectral embedding for non-linear dimensionality. + + For a comparison of dimensionality reduction techniques, + see :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. + References ---------- .. [1] "Nonmetric multidimensional scaling: a numerical method" Kruskal, J. From b33c6a48bdd74ae08bd4667c5a927bf9424057d2 Mon Sep 17 00:00:00 2001 From: "@davidcherney" Date: Sun, 25 Aug 2024 14:44:37 -0600 Subject: [PATCH 2/6] corrected: add content to MDS class definition --- sklearn/manifold/_mds.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index be2787b595aca..a3d0d06cde100 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -90,20 +90,6 @@ def _smacof_single( n_iter : int The number of iterations corresponding to the best stress. - See Also - -------- - sklearn.decomposition.PCA : Principal component analysis that is a linear - dimensionality reduction method. - sklearn.decomposition.KernelPCA : Non-linear dimensionality reduction using - kernels and PCA. - Isomap : Non-linear dimensionality reduction through Isometric Mapping. - TSNE : T-distributed Stochastic Neighbor Embedding. - LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding. - SpectralEmbedding : Spectral embedding for non-linear dimensionality. - - For a comparison of dimensionality reduction techniques, - see :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. - References ---------- .. [1] "Nonmetric multidimensional scaling: a numerical method" Kruskal, J. @@ -515,6 +501,9 @@ class MDS(BaseEstimator): LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding. SpectralEmbedding : Spectral embedding for non-linear dimensionality. + For a comparison of manifold learning techniques, + see :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. + References ---------- .. [1] "Nonmetric multidimensional scaling: a numerical method" Kruskal, J. From 8f3e16cd22dec1599c4a28930e9503904c756a97 Mon Sep 17 00:00:00 2001 From: "@davidcherney" Date: Sun, 25 Aug 2024 14:49:35 -0600 Subject: [PATCH 3/6] fixed whitespace: linting --- sklearn/manifold/_mds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index a3d0d06cde100..7c0fb31c38ed1 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -501,9 +501,9 @@ class MDS(BaseEstimator): LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding. SpectralEmbedding : Spectral embedding for non-linear dimensionality. - For a comparison of manifold learning techniques, + For a comparison of manifold learning techniques, see :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. - + References ---------- .. [1] "Nonmetric multidimensional scaling: a numerical method" Kruskal, J. From 03c2b63a1efb395f971bf23a1c0221e3742cd5d0 Mon Sep 17 00:00:00 2001 From: "@davidcherney" Date: Mon, 26 Aug 2024 05:47:55 -0600 Subject: [PATCH 4/6] trying out pre-commit --- sklearn/manifold/_mds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index 7c0fb31c38ed1..873358a379007 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -527,8 +527,8 @@ class MDS(BaseEstimator): >>> X_transformed.shape (100, 2) - For a more detailed example of usage, see: - :ref:`sphx_glr_auto_examples_manifold_plot_mds.py` + For a more detailed example of usage, see + :ref:`sphx_glr_auto_examples_manifold_plot_mds.py`. """ _parameter_constraints: dict = { From 084ad2ab2eec311ae66359393f98ad6e9a1f5b89 Mon Sep 17 00:00:00 2001 From: "@davidcherney" Date: Mon, 26 Aug 2024 06:37:33 -0600 Subject: [PATCH 5/6] trying moving new link to examples section. --- sklearn/manifold/_mds.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index 873358a379007..6a2e7f519d090 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -501,9 +501,6 @@ class MDS(BaseEstimator): LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding. SpectralEmbedding : Spectral embedding for non-linear dimensionality. - For a comparison of manifold learning techniques, - see :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. - References ---------- .. [1] "Nonmetric multidimensional scaling: a numerical method" Kruskal, J. @@ -529,6 +526,9 @@ class MDS(BaseEstimator): For a more detailed example of usage, see :ref:`sphx_glr_auto_examples_manifold_plot_mds.py`. + + For a comparison of manifold learning techniques, see + :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. """ _parameter_constraints: dict = { From 75a69122523f6922a01d6edd2b1bf2b629605d80 Mon Sep 17 00:00:00 2001 From: Arturo Amor <86408019+ArturoAmorQ@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:17:18 +0200 Subject: [PATCH 6/6] Update sklearn/manifold/_mds.py --- sklearn/manifold/_mds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index 6a2e7f519d090..a9c8e01772d15 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -528,7 +528,7 @@ class MDS(BaseEstimator): :ref:`sphx_glr_auto_examples_manifold_plot_mds.py`. For a comparison of manifold learning techniques, see - :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. + :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`. """ _parameter_constraints: dict = {