Spatial Machine Learning
Why the usual rules break, and what to do instead.
Spatial data violates the one assumption every default in scikit-learn is built on: that rows are independent. Nearby samples are near-duplicates, so a random train-test split scores a model on data it has effectively seen, and the number that comes out is not wrong so much as answering a question nobody asked. These guides cover leakage and spatial cross-validation, building features that generalise, turning predictions back into a raster, the area of applicability, and reading a prediction map for the artefacts that say the model is extrapolating.
Start here
The cornerstone guide — the whole workflow end to end. Everything after it goes deeper into one part of it.
Step 1 Spatial Machine Learning Explained: Why Location Breaks the Usual Rules spatial machine learning explained Begin the path →The full path, in order
14 guides: the concepts underneath the work, then each task, then the errors that task produces. Work down, or jump to the step you need.
- Spatial Leakage Explained: Why Random Cross-Validation Lies spatial leakage explained 🧭 Concept
- Spatial Features Explained: Turning Geometry into Columns spatial features explained 🧭 Concept
- How to Sample Training Points from Rasters and Polygons sample training points python ⚙️ How-To
- How to Build Spatial Features for a Machine Learning Model build spatial features python ⚙️ How-To
- How to Do Spatial Cross-Validation in Python spatial cross validation python ⚙️ How-To
- My Model Scores 0.95 in Testing and Fails in the Field model scores high fails in field 🔧 Fix
- How to Predict a Continuous Surface with Random Forest random forest spatial prediction python ⚙️ How-To
- How to Turn Model Predictions Back into a Raster predictions to raster python ⚙️ How-To
- My Prediction Raster Is Striped, Blocky or Full of NoData prediction raster artefacts 🔧 Fix
- How to Evaluate a Spatial Model Honestly evaluate spatial model python ⚙️ How-To
- Extrapolation in Space Explained: The Area of Applicability area of applicability explained 🧭 Concept
- Feature Importance Says Coordinates Are the Best Predictor coordinates dominate feature importance 🔧 Fix
- How to Handle Class Imbalance in a Spatial Classifier class imbalance spatial classifier ⚙️ How-To
Topics this path covers
A path is a route; a topic is everything the site has on a subject. Open a topic to see the guides this path skips.