⚠️ WARNING: sklearn-raster is in active development!⚠️
- 🗺️ Raster predictions from scikit-learn estimators
- ⚡ Parallelized functions + larger-than-memory data using Dask
- 🌐 Automatic handling of spatial references, band names, and masks
-
Install optional dependencies for loading data and plotting results:
pip install "sklearn-raster[tutorials] @ git+https://github.com/lemma-osu/sklearn-raster.git"
-
Wrap a
scikit-learn
estimator to enable raster-based predictions:from sklearn.ensemble import RandomForestRegressor from sklearn_raster import wrap est = wrap(RandomForestRegressor())
-
Load a custom dataset of features and targets and fit the wrapped estimator:
from sklearn_raster.datasets import load_swo_ecoplot X_image, X, y = load_swo_ecoplot(as_dataset=True) est.fit(X, y)
-
Generate predictions from a
numpy
orxarray
raster with predictors as bands:pred = est.predict(X_image) pred["PSME_COV"].plot()
Thanks to the USDA Forest Service Region 6 Ecology Team for the inclusion of the SWO Ecoplot dataset (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).
- 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.