Skip to content

Commit 3962c28

Browse files
authored
DOC Added example comparing L1-based models to ARD user guide (scikit-learn#31425)
1 parent 1fae098 commit 3962c28

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

doc/modules/linear_model.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,11 @@ prior over all :math:`\lambda_i` is chosen to be the same gamma distribution
837837
given by the hyperparameters :math:`\lambda_1` and :math:`\lambda_2`.
838838

839839
ARD is also known in the literature as *Sparse Bayesian Learning* and *Relevance
840-
Vector Machine* [3]_ [4]_. For a worked-out comparison between ARD and `Bayesian
841-
Ridge Regression`_, see the example below.
840+
Vector Machine* [3]_ [4]_.
842841

843-
.. rubric:: Examples
844-
845-
* :ref:`sphx_glr_auto_examples_linear_model_plot_ard.py`
842+
See :ref:`sphx_glr_auto_examples_linear_model_plot_ard.py` for a worked-out comparison between ARD and `Bayesian Ridge Regression`_.
846843

844+
See :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py` for a comparison between various methods - Lasso, ARD and ElasticNet - on correlated data.
847845

848846
.. rubric:: References
849847

sklearn/linear_model/_bayes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,6 @@ class ARDRegression(RegressorMixin, LinearModel):
568568
--------
569569
BayesianRidge : Bayesian ridge regression.
570570
571-
Notes
572-
-----
573-
For an example, see :ref:`examples/linear_model/plot_ard.py
574-
<sphx_glr_auto_examples_linear_model_plot_ard.py>`.
575-
576571
References
577572
----------
578573
D. J. C. MacKay, Bayesian nonlinear modeling for the prediction
@@ -594,6 +589,12 @@ class ARDRegression(RegressorMixin, LinearModel):
594589
ARDRegression()
595590
>>> clf.predict([[1, 1]])
596591
array([1.])
592+
593+
- :ref:`sphx_glr_auto_examples_linear_model_plot_ard.py` demonstrates ARD
594+
Regression.
595+
- :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py`
596+
showcases ARD Regression alongside Lasso and Elastic-Net for sparse,
597+
correlated signals, in the presence of noise.
597598
"""
598599

599600
_parameter_constraints: dict = {

sklearn/linear_model/_coordinate_descent.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,10 @@ class ElasticNet(MultiOutputMixin, RegressorMixin, LinearModel):
875875
1.451
876876
>>> print(regr.predict([[0, 0]]))
877877
[1.451]
878+
879+
- :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py`
880+
showcases ElasticNet alongside Lasso and ARD Regression for sparse
881+
signal recovery in the presence of noise and feature correlation.
878882
"""
879883

880884
# "check_input" is used for optimisation and isn't something to be passed
@@ -1304,6 +1308,11 @@ class Lasso(ElasticNet):
13041308
[0.85 0. ]
13051309
>>> print(clf.intercept_)
13061310
0.15
1311+
1312+
- :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py`
1313+
compares Lasso with other L1-based regression models (ElasticNet and ARD
1314+
Regression) for sparse signal recovery in the presence of noise and
1315+
feature correlation.
13071316
"""
13081317

13091318
_parameter_constraints: dict = {

0 commit comments

Comments
 (0)