Skip to content

Commit a9cddb7

Browse files
committed
DOC: Add example links to Ridge estimators docstrings (addressing review comments)
1 parent c23c63b commit a9cddb7

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

sklearn/linear_model/_ridge.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ def ridge_regression(
436436
reasons, using `alpha = 0` with the `Ridge` object is not advised.
437437
Instead, you should use the :class:`LinearRegression` object.
438438
439+
For an example on how the model coefficients
440+
vary with the regularization strength,
441+
see :ref:`<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>`.
442+
439443
If an array is passed, penalties are assumed to be specific to the
440444
targets. Hence they must correspond in number.
441445
@@ -1038,9 +1042,9 @@ class Ridge(MultiOutputMixin, RegressorMixin, _BaseRidge):
10381042
If an array is passed, penalties are assumed to be specific to the
10391043
targets. Hence they must correspond in number.
10401044
1041-
See :ref:`Ridge coefficients as a function of the L2 Regularization
1042-
<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>` for an example
1043-
on how the model coefficients vary with the regularization strength.
1045+
See :ref:`<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>`
1046+
for an example on how the model coefficients
1047+
vary with the regularization strength.
10441048
10451049
fit_intercept : bool, default=True
10461050
Whether to fit the intercept for this model. If set
@@ -1369,6 +1373,10 @@ class RidgeClassifier(_RidgeClassifierMixin, _BaseRidge):
13691373
:class:`~sklearn.linear_model.LogisticRegression` or
13701374
:class:`~sklearn.svm.LinearSVC`.
13711375
1376+
For an example on how the model coefficients vary
1377+
with the regularization strength,
1378+
see :ref:`<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>`.
1379+
13721380
fit_intercept : bool, default=True
13731381
Whether to calculate the intercept for this model. If set to false, no
13741382
intercept will be used in calculations (e.g. data is expected to be
@@ -2537,6 +2545,10 @@ class RidgeCV(MultiOutputMixin, RegressorMixin, _BaseRidgeCV):
25372545
:class:`~sklearn.svm.LinearSVC`.
25382546
If using Leave-One-Out cross-validation, alphas must be strictly positive.
25392547
2548+
For an example on how the model coefficients vary
2549+
with the regularization strength,
2550+
see :ref:`<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>`.
2551+
25402552
fit_intercept : bool, default=True
25412553
Whether to calculate the intercept for this model. If set
25422554
to false, no intercept will be used in calculations
@@ -2721,6 +2733,10 @@ class RidgeClassifierCV(_RidgeClassifierMixin, _BaseRidgeCV):
27212733
:class:`~sklearn.svm.LinearSVC`.
27222734
If using Leave-One-Out cross-validation, alphas must be strictly positive.
27232735
2736+
For an example on how the model coefficients vary
2737+
with the regularization strength,
2738+
see :ref:`<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>`.
2739+
27242740
fit_intercept : bool, default=True
27252741
Whether to calculate the intercept for this model. If set
27262742
to false, no intercept will be used in calculations

0 commit comments

Comments
 (0)