Skip to content

DOC: Add link to plot_nnls example #31280

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AidenFrank
Copy link

Reference Issues/PRs

Towards #30621.

What does this implement/fix? Explain your changes.

This is intended to add a link to the Non-negative least squares example in the LimearRegression API page.
The following example is used: plot_nnls.py
This example is linked in the User Guide for Linear Regression, but not anywhere on the API page.

This is intended to add a link to the Non-negative least squares example in the LimearRegression API page.
It is towards scikit-learn#30621.
The following example is used: `plot_nnls.py`
This example is linked in the User Guide for Linear Regression, but not anywhere on the API page.
Copy link

github-actions bot commented Apr 30, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: d0295e1. Link to the linter CI: here

Copy link
Contributor

@StefanieSenger StefanieSenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AidenFrank,

thank you for your contribution!

Would you mind moving the reference to the example up into the positive constructor argument of LinearRegression? This is the ideal place for users to find the example.

Apart from this I have suggested a little re-wording.

Comment on lines 562 to 563
For an example of using Non-negative least squares in linear regression see
:ref:`sphx_glr_auto_examples_linear_model_plot_nnls.py`.
Copy link
Contributor

@StefanieSenger StefanieSenger May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to re-formulate the reference description like this to not double with the title of the example, where "Non-negative least squares" will be already displayed.

Suggested change
For an example of using Non-negative least squares in linear regression see
:ref:`sphx_glr_auto_examples_linear_model_plot_nnls.py`.
For a comparison between a linear regression model with positive constraints
on the regression coefficients and a linear regression without such constraints,
see :ref:`sphx_glr_auto_examples_linear_model_plot_nnls.py`.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the comment, I will try to update this!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @StefanieSenger, just wanted to say that I have made the changes you suggested and it looks like the CI tests had no errors!

@StefanieSenger
Copy link
Contributor

Hello @AidenFrank,

thank you for applying the changes. I will approve this PR.

@adrinjalali, do you think this is ready to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants