Skip to content

DOC Fix UserWarning in plot_gpr_prior_posterior - #29380

Merged
ArturoAmorQ merged 4 commits into
scikit-learn:mainfrom
ovenpickled:main
Jul 9, 2024
Merged

ArturoAmorQ merged 4 commits into
scikit-learn:mainfrom
ovenpickled:main

Conversation

@ovenpickled

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #29055

What does this implement/fix? Explain your changes.

set normalize_y=True in GaussianProcessRegression

Any other comments?

Please let me know if the implemented changes are correct. I am new to Open-source contribution and I am learning how to contribute efficiently. If there are any more changes required, please feel free to revert back.

@github-actions

github-actions Bot commented Jul 1, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

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

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

@ArturoAmorQ ArturoAmorQ mentioned this pull request Jul 2, 2024
7 tasks done
@ArturoAmorQ

Copy link
Copy Markdown
Member

In the rendered docs this PR raises a ConvergenceWarning whereas in my local machine this PR raises no warnings. My guess is that something changed in the fmin_l_bfgs_b optimizer with respect to the scipy version we use for building the doc (v.1.6) and my local version (v.1.14).

Maybe @glemaitre (who bumped the last version in #27910) knows better?

@ArturoAmorQ

Copy link
Copy Markdown
Member

Merging main to see if #29388 fixes the issue.

@ArturoAmorQ

Copy link
Copy Markdown
Member

The good news is that merging main did solve the UserWarning.
The bad news is that it created a RuntimeWarning somewhere else in the same example.

In any case, we can consider the original intention of #29055 to be solved. So thanks again for your contribution, @ovenpickled. Merging!

@ArturoAmorQ
ArturoAmorQ enabled auto-merge (squash) July 9, 2024 08:56
@lesteve

lesteve commented Jul 9, 2024

Copy link
Copy Markdown
Member

Example from commit before merging main had some ConvergenceWarning in the Dot-product kernel section:

/home/circleci/project/sklearn/gaussian_process/kernels.py:452: ConvergenceWarning:

The optimal value found for dimension 0 of parameter k1__constant_value is close to the specified upper bound 10.0. Increasing the bound and calling fit again may find a better value.

/home/circleci/project/sklearn/gaussian_process/kernels.py:452: ConvergenceWarning:

The optimal value found for dimension 0 of parameter k2__kernel__sigma_0 is close to the specified upper bound 10.0. Increasing the bound and calling fit again may find a better value.

/home/circleci/project/sklearn/gaussian_process/_gpr.py:476: UserWarning:

Predicted variances smaller than 0. Setting those variances to 0.

Example from last commit doesn't have these warning any more but now there is a warning later in the example in the "Rational Quadradtic kernel" section

/home/circleci/project/sklearn/gaussian_process/_gpr.py:521: RuntimeWarning:

covariance is not symmetric positive-semidefinite.

By the way there is a typo "Quadractic" (additonal d) should be "Quadratic", maybe worth fixing in this PR?

@lesteve

lesteve commented Jul 9, 2024

Copy link
Copy Markdown
Member

I just pushed a commit fixing the typo, if you can double-check c891815 @ArturoAmorQ that would be great.

@ArturoAmorQ

Copy link
Copy Markdown
Member

I just pushed a commit fixing the typo

Thanks! Nice catch.

@ArturoAmorQ
ArturoAmorQ merged commit 79afe99 into scikit-learn:main Jul 9, 2024
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 9, 2024
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.

UserWarnings in the documentation

3 participants