Skip to content
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

DOC add link to plot_covariance_estimation example in docstrings and userguide #30429

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

Conversation

stefanogaspari
Copy link

Reference Issues/PRs

PR #26927

What does this implement/fix? Explain your changes.

Added links to plot_covariance_estimation example in docstrings and userguide

Copy link

github-actions bot commented Dec 8, 2024

✔️ Linting Passed

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

Generated for commit: 006c0a1. 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 @stefanogaspari,

thanks for your PR. I have added a few remarks.

In general, I think the example should only be mentioned in the docstrings of OAS and LedoitWolf, as their regularization is the topic of the example; and GridSearchCV is only used the measure their performance.

doc/modules/covariance.rst Outdated Show resolved Hide resolved
sklearn/model_selection/_search.py Outdated Show resolved Hide resolved
@stefanogaspari
Copy link
Author

Hi @StefanieSenger ,
thank you very much for your feedback!
I proceed with the adjustments right away.

stefanogaspari and others added 3 commits December 9, 2024 22:35
References scikit-learn#26927

What does this fix?
Added links to plot_covariance_estimation example in docstrings and userguide
@StefanieSenger
Copy link
Contributor

Thank you, @stefanogaspari, that looks very good.

Please go ahead removing the mention of the example in the EmpiricalCovariance part of the Userguide, as you suggested, and then we're all set and I can recommend this PR to be merged. :)

@stefanogaspari
Copy link
Author

stefanogaspari commented Dec 10, 2024

Thank you, @stefanogaspari, that looks very good.

Please go ahead removing the mention of the example in the EmpiricalCovariance part of the Userguide, as you suggested, and then we're all set and I can recommend this PR to be merged. :)

Hi @StefanieSenger , good afternoon
I already did it : )
Thanks a lot for your help!

@StefanieSenger
Copy link
Contributor

I already did it : )

Oh yes, now I see. And you also need to fix the doctest issues shown in the CI.
I think removing the .. rubric:: Examples when no examples follow, will do.

:class:`OAS` objects to data and for visualizing their performances in terms of
likelihood.


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Remove the blank line.

Copy link
Author

Choose a reason for hiding this comment

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

@StefanieSenger : maybe I shall add .. rubric:: Examples before the note added at the end of the top paragraph "2.6 Covariance estimation"

.. rubric:: Examples

* See :ref:sphx_glr_auto_examples_covariance_plot_covariance_estimation.py for an example on how to fit :class:ShrunkCovariance , :class:LedoitWolf and :class:OAS objects to data and for visualizing their performances in terms of likelihood.

I will try it. What do you think about it?

Comment on lines 49 to 50
.. rubric:: Examples

Copy link
Contributor

@StefanieSenger StefanieSenger Dec 10, 2024

Choose a reason for hiding this comment

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

Suggested change
.. rubric:: Examples

Remove section title including blank line that follows.

The same applies below.

Copy link
Author

Choose a reason for hiding this comment

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

I'll do it right away. This is good to know for future PRs as well. Thanks

* See also :ref:`sphx_glr_auto_examples_covariance_plot_covariance_estimation.py`
for an example on how to fit a :class:`LedoitWolf` object to data and
for visualizing the performances of the Ledoit-Wolf estimator in
terms of likelihood.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
terms of likelihood.
terms of likelihood.

And it seems you also have to add a blank like here.

The same applies for the OAS.

Reason: CI shows the following errors:

sklearn/covariance/_shrunk_covariance.py:docstring of sklearn.covariance._shrunk_covariance.LedoitWolf:117: WARNING: Bullet list ends without a blank line; unexpected unindent.
sklearn/covariance/_shrunk_covariance.py:docstring of sklearn.covariance._shrunk_covariance.OAS:117: WARNING: Bullet list ends without a blank line; unexpected unindent. 

It pretty strictly follows some rules that you can look into here.

Copy link
Author

Choose a reason for hiding this comment

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

Perfect! Thanks a lot again

@StefanieSenger
Copy link
Contributor

Some general information: when you go into the CI checks overview below, you find one that says "Check the rendered docs here!". In there, you can look into how the CI build the documentation for the changed files.

For instance: modules/generated/sklearn.covariance.OAS.html [dev, stable]
(Future reference: these links will stop working after a few days or weeks, but it's just an example anyways.)

Where the first link is your branches version, the second is the main dev branch and the third link is the last releases scikit-learn version you can find on the website.

It helps to check if everything went well.

@stefanogaspari
Copy link
Author

@StefanieSenger , all the checks have passed :)
Thank you again for your support!

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