Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sklearn-raster

PyPI version Build status Documentation status

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

sklearn-raster extends scikit-learn and other compatible estimators to work directly with raster data. This allows you to train models with tabular data and predict raster outputs directly while preserving metadata like spatial references, band names, and NoData masks.

Features

  • ⚡ 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 with a FeatureArrayEstimator to enable raster-based predictions:

    from sklearn.ensemble import RandomForestRegressor
    from sklearn_raster import FeatureArrayEstimator
    
    est = FeatureArrayEstimator(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.

Metadata

Release files for sklearn-raster 0.1.0.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sklearn-raster 0.1.0.dev2
File Size Uploaded
sklearn_raster-0.1.0.dev2.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sklearn-raster 0.1.0.dev2
File Interpreter ABI Platform
sklearn_raster-0.1.0.dev2-py3-none-any.whl Python 3 none any Details

Total release size: 58.6 kB

Release files / sklearn_raster-0.1.0.dev2.tar.gz

Download URL sklearn_raster-0.1.0.dev2.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3644a030aef7b7074be903615122bd14ccce34c862a30723fe918b17ebfa9745
BLAKE2b-256 checksum
How to use checksums
57ed63f9ea1563a3906718deac78c5abcdfe17f41fceda724646087449b45115
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.

Transparency log

Release files / sklearn_raster-0.1.0.dev2-py3-none-any.whl

Download URL sklearn_raster-0.1.0.dev2-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38584c74badfb5ee2144d0504c1a985ae1971e59049c33425670c5db3c7c0e49
BLAKE2b-256 checksum
How to use checksums
d7da9ca1ee696f19b3eaffb6b173c0f83540df894ddafe12fae9732dc3130f66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page