DOC: Add link to plot_nnls example#31280
Conversation
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.
StefanieSenger
left a comment
There was a problem hiding this comment.
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.
sklearn/linear_model/_base.py
Outdated
| For an example of using Non-negative least squares in linear regression see | ||
| :ref:`sphx_glr_auto_examples_linear_model_plot_nnls.py`. |
There was a problem hiding this comment.
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.
| 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`. |
There was a problem hiding this comment.
Thank you for the comment, I will try to update this!
There was a problem hiding this comment.
Hi @StefanieSenger, just wanted to say that I have made the changes you suggested and it looks like the CI tests had no errors!
|
Hello @AidenFrank, thank you for applying the changes. I will approve this PR. @adrinjalali, do you think this is ready to merge? |
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.pyThis example is linked in the User Guide for Linear Regression, but not anywhere on the API page.