About GeoValidate
Nearby places look alike. With random folds, test points usually sit next to training points, so the score describes places like the training data. GeoValidate trains the same Random Forest twice on your points, once with random folds and once with whole blocks of territory held out, and shows both scores with the distance between test and training points. Everything runs in your browser with scikit-learn (Pyodide); files are never uploaded.
In short
- What it uses: your own labelled points, in a CSV or GeoJSON file, which never leave your computer.
- What it does: trains the same classifier twice, once testing on random points and once testing on whole areas it has not seen.
- What it shows: whether accuracy drops when the test points are far from the training points.
- What it cannot do: measure the accuracy of a map; that needs an independent, randomly sampled reference set.
Method
| Random k-fold | Points split into k folds stratified by class. |
| Spatial block k-fold | A grid of square blocks; whole blocks go to folds, largest first to the fold with the fewest points, after shuffling with the seed. A block's points are never split between training and test. |
| Model | Per fold, a fresh pipeline: median imputation of numeric predictors, most-frequent imputation and one-hot encoding of categorical ones, then a Random Forest, all fitted on that fold's training rows only. Both designs use the same pipeline, settings and seed. |
| Distances | Lon/lat are converted to metres with a map projection centred on the data (azimuthal equidistant, which keeps distances from the centre true) (circular mean of longitude, so data across the 180° meridian work), so block sizes and buffers are in metres. The median distance from test points to the nearest training point is reported for each design. |
| Metrics | Overall accuracy, Cohen's kappa (agreement beyond what chance would give), per-class precision, recall and F1 with macro and weighted averages, over all out-of-fold predictions. Fold spread is the SD of fold accuracy. |
| Buffer | Optionally removes training points within a distance of any test point in each fold. |
| Checks | Missing or out-of-range coordinates and targets, duplicates, class imbalance, constant or identifier-like columns, coordinates used as predictors, predictors whose values each map to one class, and data spread so widely that block sizes become approximate. Problems are reported; data are not changed silently. |
Data
| Your file | CSV or GeoJSON points, up to 20 MB and 50,000 rows, read in the browser. Nothing is uploaded. |
| Sample | 5,000 points from the Mau Forest study, Kenya: 5 land-cover classes and 16 Sentinel-2 and terrain predictors. CC BY 4.0; contains modified Copernicus Sentinel-2 data. |
| Software | Pyodide 0.26.4 with scikit-learn 1.4.2, NumPy, pandas, SciPy and pyproj, downloaded from jsDelivr on first use (about 36 MB). |
| Basemap | OpenFreeMap (© OpenStreetMap contributors). |
Limits
- Spatial blocks answer a different question; they are not automatically better. Very large blocks can leave classes out of whole folds. Neither design estimates map accuracy, which needs a probability sample of reference data (Wadoux et al., 2021).
- One seed; the designs also differ in class mix per fold, so the gap is an indication, not a precise estimate.
- The block size should relate to how far spatial autocorrelation reaches; the sweep shows how the score changes with it.
- Classification only, Random Forest only, up to 50,000 rows, one thread. The first run downloads about 36 MB of Python packages.
- The sample comes from the Mau Forest study; its labels are cells where two land-cover maps agree. It is easy to classify, so its scores are optimistic about real map accuracy.
GeoValidate v. Full methodology and tests in the repository. Code MIT; sample data CC BY 4.0 (contains modified Copernicus Sentinel-2 data). Basemap © OpenStreetMap contributors, OpenFreeMap.