10000 Implementing correlation model kernels · Issue #3138 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Implementing correlation model kernels #3138

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

Closed
worldveil opened this issue May 7, 2014 · 5 comments
Closed

Implementing correlation model kernels #3138

worldveil opened this issue May 7, 2014 · 5 comments

Comments

@worldveil
Copy link

As seen here:
http://scikit-learn.org/stable/modules/gaussian_process.html#correlation-models

the Matern kernel is not implemented (as marked by TODO). What is the best route for one to take to add this kernel to scikit's library so the GP can use it?

Definition of Matern kernel:
http://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function

Perhaps a good starting point:
http://gptools.readthedocs.org/en/latest/_modules/gptools/kernel/matern.html

EDIT: To clarify, it is something I'd like to add, and I'm wondering the best way to start such that it would be accepted.

@arjoly
Copy link
Member
arjoly commented Jul 18, 2014

Thanks for your interest.

The best way would to make a pull request that adds test, documentation and the new features.
Then it would be reviewed by 2 people and merged.

@worldveil
Copy link
Author

I was asking for more specific feedback about where the code should be and what the API should be in terms of inputs and outputs.

In other words what's the desired spec?

@kastnerkyle
Copy link
Member

We are having serious discussions about this right now. The easiest way forward would be to make a simple function that takes parameters for properly constructing matern kernels, and a few tests to verify the function is correct. If you have the right function, refactoring it to a proper API after a decision is made in #3388 or another upcoming should be easy. That said, I think there will (and should) be some significant changes in the GP module in the very near future.

I am pushing hard for dumb kernels, because I think they are more general and useful.

An example

def matern(x1, x2, param1, param2, param3):
    something something
    return correlation_matrix (shape x1.shape[0] by x2.shape[0])

This is simple enough to be useful for anything, including other models that may use the same type of processing. The caller should be responsible for providing two identical matrices if they want autocorrelation in my opinion.

@arjoly
Copy link
Member
arjoly commented Jul 20, 2014

The mattern kernel should be put in the pairwise module.

@glouppe
Copy link
Contributor
glouppe commented Oct 19, 2015

Closing. The new implementation of gaussian processes (see #4270) now includes the Matern kernel.

See also #3885 for another implementation in the pairwise module.

@glouppe glouppe closed this as completed Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0