Skip to content

DOC Add link to plot_lasso_and_elasticnet.py example in linear model … #30585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sklearn/linear_model/_coordinate_descent.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ class ElasticNet(MultiOutputMixin, RegressorMixin, LinearModel):
SGDRegressor : Implements elastic net regression with incremental training.
SGDClassifier : Implements logistic regression with elastic net penalty
(``SGDClassifier(loss="log_loss", penalty="elasticnet")``).

Notes
-----
To avoid unnecessary memory duplication the X argument of the fit method
Expand All @@ -859,7 +859,10 @@ class ElasticNet(MultiOutputMixin, RegressorMixin, LinearModel):
is smaller than `tol` times the maximum absolute coefficient, :math:`\\max_j |w_j|`.
If so, then additionally check whether the dual gap is smaller than `tol` times
:math:`||y||_2^2 / n_{\text{samples}}`.


For an example showcasing Elastic-Net alongside Lasso and ARDRegression for sparse
signal recovery in the presence of noise and feature correlation, see:
:ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py`.
Examples
--------
>>> from sklearn.linear_model import ElasticNet
Expand Down Expand Up @@ -1264,6 +1267,10 @@ class Lasso(ElasticNet):
LassoCV : Lasso alpha parameter by cross-validation.
LassoLarsCV : Lasso least angle parameter algorithm by cross-validation.
sklearn.decomposition.sparse_encode : Sparse coding array estimator.

For an example comparing Lasso with other L1-based regression models
(Elastic-Net and ARDRegression) on sparse and noisy data, see:
:ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py`.

Notes
-----
Expand Down
Loading