Skip to content

DOC: Add link to plot_nnls example#31280

Merged
adrinjalali merged 2 commits intoscikit-learn:mainfrom
AidenFrank:doc_nnls_example
May 6, 2025
Merged

DOC: Add link to plot_nnls example#31280
adrinjalali merged 2 commits intoscikit-learn:mainfrom
AidenFrank:doc_nnls_example

Conversation

@AidenFrank
Copy link
Copy Markdown
Contributor

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.
@github-actions
Copy link
Copy Markdown

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
Copy Markdown
Member

@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
Copy Markdown
Member

@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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Member

Hello @AidenFrank,

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

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

@adrinjalali adrinjalali merged commit 8ba69c5 into scikit-learn:main May 6, 2025
36 checks passed
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.

3 participants