Applying a Scikit-learn regression on a lat,lon grid #7591
-
Hi everyone. I have a Dataset with coords (x, y, time), and I want to apply a Scikit-learn Theil-Sen regression on the time component (so the result would be multiple trained models for every lat,lon coordinate (it has a single variable in it). The results would be stored in a separate dimension. Can you refer to an efficient way to do this? I have thought of using some vectorized form such as apply or map, but in my attempts, I couldn't make it work. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
See https://tutorial.xarray.dev/advanced/apply_ufunc/vectorize_1d.html an example, it does something similar for the interpolation problem Start here if you are new to |
Beta Was this translation helpful? Give feedback.
-
In Scikit-downscale, we ended up using |
Beta Was this translation helpful? Give feedback.
-
I have gone with something working, but quite inefficient:
I have masked the source Dasatet ( refer to |
Beta Was this translation helpful? Give feedback.
See https://tutorial.xarray.dev/advanced/apply_ufunc/vectorize_1d.html an example, it does something similar for the interpolation problem
Start here if you are new to
apply_ufunc