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

Class to wrap a scikit-learn estimator in a Verde gridder #268

Open
leouieda opened this issue Jun 4, 2020 · 3 comments
Open

Class to wrap a scikit-learn estimator in a Verde gridder #268

leouieda opened this issue Jun 4, 2020 · 3 comments
Labels
enhancement Idea or request for a new feature

Comments

@leouieda
Copy link
Member

leouieda commented Jun 4, 2020

Description of the desired feature

The Verde gridders are basically linear models from scikit-learn with particular feature matrices (the Green's functions). But we might not want to use linear models and Green's functions for everything (for example #188 and #261). It would be helpful to have a class that wraps a given scikit-learn estimator in the Verde gridder API:

interp = vd.Gridder(estimator=SVC())
interp.fit(coordinates, data)
grid = interp.grid(...)

The assumption would be the feature matrix is a column stack of the given coordinates (each is a column in the matrix). This would allow passing in real coordinates (longitude, latitude) or other predictors (topography, ice_thickness, etc) as long as they all have the same size.

The bonus of this would be to give gridding powers to scikit-learn. So I think it's worth while.

Are you willing to help implement and maintain this feature? Yes but would welcome anyone to try it since I'm short on time

@fmaussion
Copy link

Thanks for these ideas! I'm not using verde yet so I can't really help, but I am happy to provide data for a real case example if needed

@leouieda
Copy link
Member Author

leouieda commented Jun 5, 2020

@fmaussion that would be great! Do you have any data that is openly licensed (CC-BY or public domain)? That way we can include it as sample data in the project.

@fmaussion
Copy link

I think the easiest is to just generate a fake dataset.

Here is an example of a temperature field which is the combination of a purely linear elevation dependent field and some spatially correlated randomness: https://gist.github.com/fmaussion/3206241d17bacd1a299688d27915be57

Reconstructing this field would fail miserably if only the location of observations is taken into account, and work much better if the (linear) correlation with the known elevation is also considered.

What's the best format to send you these data? NetCDF + csv ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Idea or request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants