-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC add links to plot_ridge_coeffs example #31454
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, @lsakovykh!
I have a few comments.
doc/modules/linear_model.rst
Outdated
To observe how the model coefficients are affected by different values of :math:`\alpha`, | ||
see :ref:`Ridge coefficients as a function of the L2 Regularization <sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"See <example_line> for more details."
sklearn/linear_model/_ridge.py
Outdated
See :ref:`Ridge coefficients as a function of the L2 Regularization | ||
<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>` for an example | ||
demonstrating the evolution of coefficients with regularization strength. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See :ref:`Ridge coefficients as a function of the L2 Regularization | |
<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>` for an example | |
demonstrating the evolution of coefficients with regularization strength. | |
See :ref:`Ridge coefficients as a function of the L2 Regularization | |
<sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py>` for an example | |
demonstrating the evolution of coefficients with regularization strength. |
"[...] for an example on how the model coefficients vary with the regularization strength."
Thanks a lot for your time and review! |
One of the checks (scikit-learn.scikit-learn in commit fbc9336) has been hanging in the queued status for 2 days. It looks like it's frozen. I'll try to restart it by closing and opening the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the PR, @lsakovykh! I still have a few more comments.
It'd be a good idea to include the example link in the docstrings of RidgeCV
, RidgeClassifier
, RidgeClassifierCV
, and ridge_regression
.
Thanks a lot for the review and the additional suggestions! I actually considered adding the example link to some of this classes initially, but for a first contribution, I decided to keep the scope a bit more focused on Ridge as the base. Since you think it's beneficial to include them there too, I'll definitely go ahead and add the link to RidgeCV, RidgeClassifier, RidgeClassifierCV, and ridge_regression. I'll push the updated changes shortly. Thanks again for the feedback! |
This commit adds links to the plot_ridge_coeffs example in the Ridge API documentation (alpha parameter) and the Linear Models User Guide (alpha section).
44f6942
to
06a47f6
Compare
This Pull Request addresses the meta-issue #30621 by adding direct links to the
Ridge coefficients as a function of the L2 Regularization
example (plot_ridge_coeffs.py
) in two relevant locations within thescikit-learn
documentation.What has been done:
plot_ridge_coeffs.py
has been added to the docstring of thealpha
parameter insklearn/linear_model/_ridge.py
. This provides users with a quick visual example of how regularization strength affects coefficients directly from the API documentation.doc/modules/linear_model.rst
). This enhances discoverability for users reading about linear models.Challenges encountered during local documentation build:
During the local development and testing, I encountered persistent issues with building the documentation. Specifically, the build process failed due to compilation errors related to
sphinxcontrib-sass
and itslibsass
dependency, as well asruamel.yaml.clib
. These issues were consistently observed on Windows, regardless of the Python version used (3.13, 3.11, 3.10) within isolated Conda environments. The problem appears to stem from incompatibilities between the C extensions of these libraries and the Python 3.13 environment (or potentially MSVC compiler specifics on newer Python versions on Windows).Due to these unresolvable local build failures, I am submitting this PR for CI review, trusting that the automated checks will ensure the documentation renders correctly. The changes themselves are minor documentation links using standard Sphinx/Sphinx-Gallery syntax and should not introduce any logical errors.
Reference Issues/PRs
Towards #30621