Skip to main content

Spatial raster prediction with scikit-learn estimators.

Project description

sklearn-raster

Build status Documentation status

⚠️ WARNING: sklearn-raster is in active development! ⚠️

Features

  • 🗺️ Raster predictions from scikit-learn estimators
  • ⚡ Parallelized functions + larger-than-memory data using Dask
  • 🌐 Automatic handling of spatial references, band names, and masks
  • 🔢 Support for n-dimensional feature arrays, e.g. time series rasters

Quick-Start

  1. Install optional dependencies for loading data and plotting results:

    pip install "sklearn-raster[tutorials]"
    
  2. Wrap a scikit-learn estimator to enable raster-based predictions:

    from sklearn.ensemble import RandomForestRegressor
    from sklearn_raster import wrap
    
    est = wrap(RandomForestRegressor())
    
  3. 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)
    
  4. Generate predictions from a numpy or xarray raster with predictors as bands:

    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 (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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sklearn_raster-0.1.0.dev0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sklearn_raster-0.1.0.dev0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file sklearn_raster-0.1.0.dev0.tar.gz.

File metadata

  • Download URL: sklearn_raster-0.1.0.dev0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sklearn_raster-0.1.0.dev0.tar.gz
Algorithm Hash digest
SHA256 d4303d6334c76611ed84321692538e05f88162fc9661781379ca2dc8640c8329
MD5 4e8a8cae71cf7f27f0ec0c91f0c7b816
BLAKE2b-256 5ca824ccb9a6842ef3adea494a7731ad1cce42618aa1ee8723f3ed242fe3ec12

See more details on using hashes here.

Provenance

The following attestation bundles were made for sklearn_raster-0.1.0.dev0.tar.gz:

Publisher: publish.yaml on lemma-osu/sklearn-raster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sklearn_raster-0.1.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for sklearn_raster-0.1.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 16d9312240a8059ada45d9b7966562190ff47aea5d9a2eb4c72fb033a14df748
MD5 eb25831a863772d483bac248b17d4776
BLAKE2b-256 04dd4ebca339612bfd9295bb9dfc0f64522fe32ac8810f88d0ba462376611ac1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sklearn_raster-0.1.0.dev0-py3-none-any.whl:

Publisher: publish.yaml on lemma-osu/sklearn-raster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page