-
-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
[MRG] Allow usage of nu=inf in Matern kernel #15503
Conversation
This contribution looks good to me. Looking at the referenced issue, it doesn't seem like a decision was reached on whether this should be implemented, so it might be a good idea to ping them to finish the discussion. |
I'm okay with it if it makes the parameter more searchable
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sam-dixon !
Please add unit tests for this feature under sklearn/gaussian_process/tests/test_kernels.py
in particular,
- that with
nu=inf
the output is equal to the RBF kernel - that for large
nu
asymptotically this kernel yields approximately the same result asnu=inf
Also please add an entry to the change log at doc/whats_new/v0.22.rst
. Like the other entries there, please reference this pull request with :pr:
and credit yourself (and other contributors if applicable) with :user:
.
@@ -259,6 +263,11 @@ def test_matern_kernel(): | |||
K1 = Matern(nu=nu, length_scale=1.0)(X) | |||
K2 = Matern(nu=nu + tiny, length_scale=1.0)(X) | |||
assert_array_almost_equal(K1, K2) | |||
# test that coef0==large is close to RBF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so you might also want to check that they are not too close!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise lgtm
@sam-dixon do you think you could find some time to sync to upstream and address the comments? Thanks! |
43f6807
to
9f30421
Compare
Reference Issues/PRs
Fixes #12031
What does this implement/fix? Explain your changes.
If the
nu
parameter is set toinf
, the kernel is equivalent to the RBF kernel, as specified in the documentation.Tests
Returns
True, True
Any other comments?