Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lemma-osu/sklearn-raster
Spatial raster prediction with scikit-learn estimators
https://github.com/lemma-osu/sklearn-raster
raster scikit-learn xarray
Last synced: about 8 hours ago
JSON representation
Spatial raster prediction with scikit-learn estimators
- Host: GitHub
- URL: https://github.com/lemma-osu/sklearn-raster
- Owner: lemma-osu
- Created: 2023-08-30T20:20:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-15T21:42:09.000Z (1 day ago)
- Last Synced: 2025-01-15T23:42:33.228Z (1 day ago)
- Topics: raster, scikit-learn, xarray
- Language: Python
- Homepage: https://sklearn-raster.readthedocs.io
- Size: 161 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# sklearn-raster
[![Build status](https://github.com/lemma-osu/sklearn-raster/actions/workflows/ci.yaml/badge.svg)](https://github.com/lemma-osu/sklearn-raster/actions/workflows/ci.yaml) [![Documentation status](https://readthedocs.org/projects/sklearn-raster/badge/?version=latest)](https://sklearn-raster.readthedocs.io/)
> β οΈ **WARNING: sklearn-raster is in active development!** β οΈ
## Features
- πΊοΈ Raster predictions from [scikit-learn](https://scikit-learn.org/stable/) estimators
- β‘ Parallelized functions + larger-than-memory data using [Dask](https://www.dask.org/)
- π Automatic handling of spatial references, band names, and masks## Quick-Start
1. Install optional dependencies for loading data and plotting results:
```bash
pip install "sklearn-raster[tutorials] @ git+https://github.com/lemma-osu/sklearn-raster.git"
```1. Wrap a `scikit-learn` estimator to enable raster-based predictions:
```python
from sklearn.ensemble import RandomForestRegressor
from sklearn_raster import wrapest = wrap(RandomForestRegressor())
```1. Load a [custom dataset](https://sklearn-raster.readthedocs.io/en/latest/api/datasets/swo_ecoplot) of features and targets and fit the wrapped estimator:
```python
from sklearn_raster.datasets import load_swo_ecoplotX_image, X, y = load_swo_ecoplot(as_dataset=True)
est.fit(X, y)
```1. Generate predictions from a `numpy` or `xarray` raster with predictors as bands:
```python
pred = est.predict(X_image)
pred["PSME_COV"].plot()
```## Acknowledgements
Thanks to the USDA Forest Service Region 6 Ecology Team for the inclusion of the [SWO Ecoplot dataset](https://sklearn-raster.readthedocs.io/en/latest/api/datasets/swo_ecoplot) (Atzet et al., 1996). Development of this package was funded by:
- an appointment to the United States Forest Service (USFS) Research Participation Program administered by the Oak Ridge Institute for Science and Education (ORISE) through an interagency agreement between the U.S. Department of Energy (DOE) and the U.S. Department of Agriculture (USDA).
- a joint venture agreement between USFS Pacific Northwest Research Station and Oregon State University (agreement 19-JV-11261959-064).
- a cost-reimbursable agreement between USFS Region 6 and Oregon State University (agreeement 21-CR-11062756-046).## References
- Atzet, T, DE White, LA McCrimmon, PA Martinez, PR Fong, and VD Randall. 1996. Field guide to the forested plant associations of southwestern Oregon. USDA Forest Service. Pacific Northwest Region, Technical Paper R6-NR-ECOL-TP-17-96.