[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.
Thanks @sam-dixon !
Please add unit tests for this feature under sklearn/gaussian_process/tests/test_kernels.py in particular,
- that with
nu=infthe output is equal to the RBF kernel - that for large
nuasymptotically 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:.
| 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.
If so you might also want to check that they are not too close!
|
@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
nuparameter is set toinf, the kernel is equivalent to the RBF kernel, as specified in the documentation.Tests
Returns
True, TrueAny other comments?