From 906d6c664ec0865de29ab997c1b2790b425edbf9 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sat, 21 Jun 2025 15:52:05 +0530 Subject: [PATCH 1/8] DOC Add link to plot_lasso_coordinate_descent_path in lasso_path docstring --- sklearn/linear_model/_coordinate_descent.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 940ae6f5e3a30..1d06744092708 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -355,6 +355,11 @@ def lasso_path( >>> print(coef_path_continuous([5., 1., .5])) [[0. 0. 0.46915237] [0.2159048 0.4425765 0.23668876]] + + For a visual example of computing and plotting the Lasso coordinate + descent path, see + :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path.py`. + """ return enet_path( X, From ae743f0043ccc6ae8bef2a78e53ea1b5cede91b2 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sat, 21 Jun 2025 17:17:54 +0530 Subject: [PATCH 2/8] DOC improve docstring in lasso_path with example reference (#30621) --- sklearn/linear_model/_coordinate_descent.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 1d06744092708..aa10212ff3843 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -357,9 +357,8 @@ def lasso_path( [0.2159048 0.4425765 0.23668876]] For a visual example of computing and plotting the Lasso coordinate - descent path, see + descent path, see the example: :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path.py`. - """ return enet_path( X, From 47d2b49c122e77926d954611814dbf5e774eb429 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sat, 21 Jun 2025 17:17:54 +0530 Subject: [PATCH 3/8] DOC improve docstring in lasso_path with example reference (#30621) --- sklearn/linear_model/_coordinate_descent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index aa10212ff3843..9ea06fe4efcf3 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -358,7 +358,7 @@ def lasso_path( For a visual example of computing and plotting the Lasso coordinate descent path, see the example: - :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path.py`. + :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path` """ return enet_path( X, From 0c97e0241aea4c479b2fe7319a3b7f79e4846a67 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sat, 21 Jun 2025 21:42:10 +0530 Subject: [PATCH 4/8] DOC add example reference for Lasso coordinate descent path in lasso_path docstring --- sklearn/linear_model/_coordinate_descent.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 9ea06fe4efcf3..e7bff8a972d43 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -322,6 +322,10 @@ def lasso_path( :ref:`examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py `. + For a visual example of computing and plotting the Lasso coordinate + descent path, see the example: + :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path`. + To avoid unnecessary memory duplication the X argument of the fit method should be directly passed as a Fortran-contiguous numpy array. @@ -356,9 +360,6 @@ def lasso_path( [[0. 0. 0.46915237] [0.2159048 0.4425765 0.23668876]] - For a visual example of computing and plotting the Lasso coordinate - descent path, see the example: - :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path` """ return enet_path( X, From d84a82ffe0cea1dcaf512677d779bf4ecc42052b Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sat, 21 Jun 2025 22:39:51 +0530 Subject: [PATCH 5/8] DOC add link to visual example in lasso_path Examples section --- sklearn/linear_model/_coordinate_descent.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index e7bff8a972d43..86dd5466fa784 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -322,10 +322,6 @@ def lasso_path( :ref:`examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py `. - For a visual example of computing and plotting the Lasso coordinate - descent path, see the example: - :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path`. - To avoid unnecessary memory duplication the X argument of the fit method should be directly passed as a Fortran-contiguous numpy array. @@ -349,6 +345,9 @@ def lasso_path( [[0. 0. 0.46874778] [0.2159048 0.4425765 0.23689075]] + For a full visual example using this function, see: + :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path`. + >>> # Now use lars_path and 1D linear interpolation to compute the >>> # same path >>> from sklearn.linear_model import lars_path From 99dd939ffecdf0a01a739e12b800038f2ede4722 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sun, 22 Jun 2025 00:16:24 +0530 Subject: [PATCH 6/8] DOC add link to coordinate descent example in lasso_path docstring --- sklearn/linear_model/_coordinate_descent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 86dd5466fa784..7e1584eb69339 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -345,7 +345,8 @@ def lasso_path( [[0. 0. 0.46874778] [0.2159048 0.4425765 0.23689075]] - For a full visual example using this function, see: + For a visual example using this function, see: + :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path`. >>> # Now use lars_path and 1D linear interpolation to compute the From a2e3c7f1d73adf562e6013b0a52227085e342b98 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sun, 22 Jun 2025 03:16:02 +0530 Subject: [PATCH 7/8] DOC add coordinate descent visual example link in lasso_path Notes --- sklearn/linear_model/_coordinate_descent.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 7e1584eb69339..fbe10c7b63373 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -320,7 +320,11 @@ def lasso_path( ----- For an example, see :ref:`examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py - `. + `.\ + + For a visual example of computing and plotting the Lasso coordinate + descent path, see: + :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path`. To avoid unnecessary memory duplication the X argument of the fit method should be directly passed as a Fortran-contiguous numpy array. @@ -345,10 +349,6 @@ def lasso_path( [[0. 0. 0.46874778] [0.2159048 0.4425765 0.23689075]] - For a visual example using this function, see: - - :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path`. - >>> # Now use lars_path and 1D linear interpolation to compute the >>> # same path >>> from sklearn.linear_model import lars_path From 7780d57130f5e024278a47a2d1ebea96e64646b1 Mon Sep 17 00:00:00 2001 From: VirenPassi Date: Sun, 22 Jun 2025 03:45:57 +0530 Subject: [PATCH 8/8] DOC fix line continuation issue in lasso_path Notes section --- sklearn/linear_model/_coordinate_descent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index fbe10c7b63373..980eb7da09182 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -318,9 +318,9 @@ def lasso_path( Notes ----- - For an example, see + For an example, see: :ref:`examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py - `.\ + `. For a visual example of computing and plotting the Lasso coordinate descent path, see: