What 02SpatialML does
Predictive mapping with machine learning in QGIS, from point or polygon samples and covariate rasters to a map with known limits: a validation designer that shows whether the folds mimic the prediction task, five models on the same folds, explanations computed on held-out data, a wall-to-wall prediction with interval, dissimilarity index and area of applicability, and a model card with a JSON manifest that replays the study. Every engine is written in NumPy.
Folds that mimic the task
Random -fold, square and hexagonal blocks, coordinate clusters, buffered leave-one-out and kNNDM; block size from the variogram range; nearest-neighbour distance curves of samples, prediction locations and each design, with the Wasserstein distance per design.
Five models, same folds
OLS baseline, random forest with quantile regression forest intervals, gradient boosting with split-conformal intervals, GWR and MGWR, tuned by nested cross-validation; a leaderboard with spatial-CV , RMSE, interval coverage, residual Moran's and the optimism gap.
Held-out explanations, AOA
Permutation importance, exact TreeSHAP, partial dependence with ICE, accumulated local effects and local GWR/MGWR coefficients; the prediction is masked to the area of applicability (Meyer & Pebesma 2021).
Install, then run the demo
In QGIS, open Plugins › Manage and Install Plugins, search for 02SpatialML and install it, or install a release zip with Install from ZIP.
QGIS 3.28 or later (QGIS 4 included). NumPy and GDAL ship with QGIS. SciPy is used for neighbour queries when present, with identical results without it. scikit-learn is optional (a faster random forest engine for large sample sets). The native engines are checked against PySAL mgwr, shap, scikit-learn and CAST.
Open the lab
Click the 02SpatialML toolbar button; the lab opens as a dock on the right.
Load the demo landscape
On Data, press Load demo landscape: 400 point samples in 8 clusters over the western two thirds of a -cell (50 m) landscape in EPSG:32635, with five covariate rasters. The eastern third holds covariate values outside every sampled value.
Run the study
Press Run whole study, or walk through the pages: Run explore, Make folds, Run validation, Run explanations, Predict.
Read the result
On Models, the random -fold error is lower than the spatial-block error (the optimism gap). On Predict, the AOA layer marks the eastern third as outside the area of applicability. On Report, write the model card and the manifest, then press Replay manifest.
The lab dock, page by page
The lab is a dock on the right of the QGIS window with an icon rail of seven pages, Settings and Help. Long steps run as QGIS background tasks with a progress bar and a Cancel button.
| Page | What it holds |
|---|---|
| 1. Data | Samples layer, target field (regression or classification detected, with an override), attribute covariates, covariate rasters with a categorical toggle, polygon statistic and point buffer; a working CRS badge, Load demo landscape and Run whole study. |
| 2. Explore | Target histogram, correlation heatmap with the variance inflation factor, and the variogram of the target and of the OLS residuals with its practical range. |
| 3. Validation | Design chips, , block size or radius prefilled from the variogram range, Preview folds on map and the distance diagnostics. |
| 4. Models | Model and engine choice (native NumPy or scikit-learn when installed), nested tuning, Run validation, the leaderboard, KPI cards for the best model and Show residuals on map. |
| 5. Explain | Permutation importance with fold whiskers, a TreeSHAP summary, PDP with ICE curves and ALE for any covariate, the GWR/MGWR local coefficient layer and the bandwidth per term. |
| 6. Predict | Raster grid or vector layer, interval level, area of applicability, tile size; layers for the prediction masked to the AOA, the full mean, interval width, dissimilarity index and the AOA mask. |
| 7. Report | Model card (HTML), run manifest (JSON), cross-validation predictions (CSV) and layers (GeoPackage); Replay manifest rebuilds the table, checks the hashes, refits and compares every metric. |
Processing provider
The plugin registers a 02SpatialML provider with 11 algorithms in the Processing Toolbox, usable in models, batch mode and scripts.
| Group | Algorithm |
|---|---|
| Whole study | Spatial machine learning lab (whole study) |
| Data | Build sample table |
| Data | Harmonise covariate rasters |
| Explore | Empirical variogram |
| Validation design | Make spatial folds |
| Validation design | Nearest-neighbour distance diagnostics |
| Models | Cross-validate model |
| Explanation | Explain model (importance, SHAP, PDP / ALE) |
| Prediction | Fit and predict raster |
| Prediction | Area of applicability |
| Record | Replay run manifest |
Full manual
02SpatialML manual
Every page and parameter, methods and formulas, output fields, the worked demo example, limitations and references.
Citation and licence
| Name | 02SpatialML - Spatial Machine Learning Lab |
| Package | zero2spatialml |
| Version | 0.1.0 |
| QGIS | 3.28 or newer; QGIS 4 supported |
| Licence | GPL-2.0-or-later (LICENSE) |
| Developer | Geophilo · Yusuf Eminoğlu (ORCID 0009-0005-6000-2934) |
| Source | gitlab.com/geophilo1/zero2spatialml |
| Issues | gitlab.com/geophilo1/zero2spatialml/-/work_items |
| Hub | plugins.qgis.org search: zero2spatialml (listing pending) |
| Revision | November 2026 |
Eminoğlu, Y. (2026). 02SpatialML - Spatial Machine Learning Lab (version 0.1.0) [QGIS plugin]. https://gitlab.com/geophilo1/zero2spatialml