Appendix for the paper ‘Moving beyond spatial and random cross-validation in environmental modelling: a call for prediction-domain adaptive evaluation’
Published
Last Updated: April, 2026
1 Introduction
This appendix complements the paper “Moving beyond spatial and random cross-validation in environmental modelling: a call for prediction-domain adaptive evaluation” by detailing data, experimental design, diagnostics, and evaluation results used to compare map-accuracy estimation strategies under different scenarios. Using above‑ground biomass as the response and 28 environmental predictors, we contrast different sampling designs ranging from randomly distributed training points over weakly clustered and more clustered sampling designs to a design requiring extrapolation to a completely distinct area. We implement and visualize four accuracy-estimation strategies, design-based sampling, random cross-validation (CV), spatial CV, and prediction-domain adaptive CV, and analyze how each aligns with the actual prediction problem.
Specifically, the appendix:
Describes the study area, response, and predictors.
Defines the four sampling designs (random, weakly clustered, strongly clustered and extrapolation) and shows design-based splits and CV folds.
Quantifies how each CV induces train–test separation in geographic and predictor spaces, comparing training-to-training vs prediction-to-training distances.
Introduces the Area of Applicability (AOA) and examines distance distributions inside vs outside the AOA.
Details the modeling setup and the evaluation protocol: population (“true”) RMSE vs estimated RMSE, together with AOA coverage, repeated 100 times.
Key findings
random CV is adequate for well-covered interpolation but optimistic elsewhere,
spatial CV can be pessimistic for interpolation using random sample yet better for clustered/extrapolation,
prediction-domain adaptive CV adapts across scenarios,
design-based sampling of the prediction domain best captures true RMSE, and
AOA coverage helps interpret when CV estimates are more or less transferable to the prediction domain.
# helper to get legend from cowplotget_legend_35 =function(plot) {# return all legend candidates legends =get_plot_component(plot, "guide-box", return_all =TRUE)# find non-zero legends nonzero =vapply(legends, \(x) !inherits(x, "zeroGrob"), TRUE) idx =which(nonzero)# return first non-zero legend if exists, and otherwise first element (which will be a zeroGrob)if (length(idx) >0) {return(legends[[idx[1]]]) } else {return(legends[[1]]) }}
The data used in this study is adapted from Wadoux et al. (2021), where it is described in detail.
The outcome variable is ABG1, representing above-ground biomass in megagrams per hectare. The extrapolation-scenario is created by sampling only in the western half of the study area, while the eastern half is entirely free of training samples (Figure 1). In this extrapolation scenario, the model is expected to predict values outside the locations of the available training data.
Figure 1: Map of above-ground biomass (AGB) in the study area. The interpolation area encompasses the whole available data, while the extrapolation area is the eastern half of the study area (outlined in gold).
28 predictors representing various variables, including climatic variables, elevation, soil properties and remote sensing data were used to predict the outcome variable (Figure 2).
We consider four different training sampling designs: random, weakly clustered, strongly clustered and extrapolation. These different designs define a continuum ranging from interpolation towards extrapolation. Within random sampling, training points are distributed randomly across the study area, whereas in clustered sampling, training points are grouped into clusters with many unsampled areas in between (Figure 3).
The design-based sampling always covers the entire prediction area – which is the eastern part of the study area for the extrapolation design. In the design-based approach, we used 350 points for training (yellow) and 150 points for evaluation (red) to mimic a realistic scenario where 30% of the sampling effort is directed towards evaluation.
Figure 4 shows the different cross-validation folds for the three different CV strategies, as well as the design-based split. Each color indicates a different fold. In design-based sampling, yellow indicates test points, and black indicates training points.
Figure 4: Evaluation strategies for map accuracy estimation in the four different sampling designs of the training data. The different colors indicate the different cross-validation folds and the train/test split for design-based sampling.
3 Properties of the cross-validation strategies
3.1 Relationship between cross-validation and spatial distances
Figure 5 shows the distribution of spatial nearest-neighbor distances1 between training points (training-to-training) and between prediction cells and training points (prediction-to-training) for the four different sampling designs of the training data. The training-to-training and prediction-to-training distance distributions overlap largely for the random training sampling, whereas they are getting more dissimilar towards the extrapolation design. Lines on the figure indicate the distribution of spatial nearest-neighbor distances between evaluation and training points for the three different cross-validation strategies – i.e., the distance from the test points in the held-out fold to the nearest training point. Random cross-validation (random CV) captures the training-to-training distances very well, but does not capture the prediction-to-training distances, which is important for the clustered and extrapolation sampling designs. Spatial cross-validation (spatial CV) is more effective at capturing prediction-to-training distances for clustered training sampling and in the extrapolation scenario, but does not capture them for random training sampling. The prediction-domain adaptive cross-validation (prediction-domain adaptive CV) adapts to the prediction situation and captures both the training-to-training and prediction-to-training distances fairly well in all scenarios (although worse for the extrapolation case).
Figure 5: Areas representing the distribution of spatial distances between training points (training-to-training) and between prediction cells and training points (prediction-to-training) for the four different sampling designs of the training data. The lines indicate the distribution of spatial distances between test and training points for the three different cross-validation strategies.
3.2 Relationship between cross-validation and predictor-space distances
Figure 6 shows the distribution of nearest neighbor distances in the predictor space2 between training points (training-to-training) and between prediction cells and training points (prediction-to-training) for the four different sampling designs of the training data. All of the results are similar to the one based on spatial distances:
The training-to-training and prediction-to-training distance distributions overlap largely for the random training sampling, while they are more dissimilar for the clustered training sampling and in the extrapolation scenario.
Random cross-validation (random CV) captures the training-to-training distances very well, but does not capture the prediction-to-training distances, which is important for the clustered training sampling and in the extrapolation scenario.
Spatial cross-validation (spatial CV) is better at capturing the prediction-to-training distances for the clustered training sampling and in the extrapolation scenario, but does not capture them for the random and weakly clustered training sampling.
The prediction-domain adaptive cross-validation (prediction-domain adaptive CV) adapts to the prediction situation and captures both the training-to-training and prediction-to-training distances fairly well in all scenarios (although worse for the extrapolation scenario).
Figure 6: Areas representing the distribution of predictor-space distances between training points (training-to-training) and between prediction cells and training points (prediction-to-training) for the four different sampling designs of the training data. The lines indicate the distribution of predictor-space distances between test and training points for the three different cross-validation strategies.
3.3 Area of applicability
Figure 7 shows the distribution of predictor-space distances between prediction cells and training points (prediction-to-training) for all prediction cells (gray filled areas) and only for the prediction cells that are inside the area of applicability (AOA) (pink filled areas with black line colour) as defined by the AOA threshold. The AOA masks prediction raster cells that are too dissimilar from the training data by excluding prediction locations that have longer predictor-space distances to their nearest training point than the longest distances found during cross-validation. Hence, the AOA defines the area where the cross-validation error estimate is expected to be reliable. Applying the AOA had little effect with random distributed and weakly clustered training points, but resulted in a better match of prediction-to-training distances and cross-validation distances in the clustered and extrapolation scenarios by masking prediction cells that are too far away from the training points. Furthermore, the cut-off threshold is much smaller for random CV than for spatial and prediction-domain adaptive CV, which means that a larger fraction of prediction cells needs to be masked for the random CV to yield reliable estimates of map accuracy.
Figure 7: Distribution of predictor-space distances between prediction cells and training points (prediction-to-training) for the four different sampling designs of the training data. The gray-filled areas indicate all of the distances, while the pink-filled areas indicate the distances that are inside the area of applicability (AOA) as defined by the AOA threshold (black dashed vertical line). The lines indicate the distribution of predictor-space distances between test and training points for the three different cross-validation strategies.
3.4 Summary
The Figure 8 summarises the findings presented above. It gives an overview of the different sampling designs (first row), and then shows the continuum from random sampling towards an extrapolation design in the second row. Here, the Wasserstein statistic was used to calculate the difference between training-to-training and prediction-to-training distance distributions. The Wasserstein statistic increases as we follow the gradient towards extrapolation, quantitatively supporting our visual assessment above. The third row shows the spatial nearest-neighbour distance distributions between cross-validation folds, while the last row shows those distances in the predictor space.
Figure 8: The upper row shows sampling designs ranging from randomly distributed training points (left) over clustered training points towards a setting where transfer to a new region is required. The second row shows areas representing the distribution of spatial distances between training points (training-to-training) and between prediction cells and training samples (prediction-to-training) for the four different sampling designs of the training data. The difference between the two density distributions is measured by the Wasserstein statistic (bold W in the figure). The third row shows spatial distances between test and training points for the three different cross-validation strategies. The last row shows those distances in the predictor space.
4 Map accuracy estimation results
4.1 Modeling and validation setup
We used random forest models to predict above-ground biomass from the 28 predictor variables. All of the models were built using the default settings of the ranger::ranger() function.
To obtain the Population reference (full-domain) RMSE, we used models built on the full training sample (for our sampling designs and prediction scenarios, see Figure 3) and compared predictions for the interpolation or extrapolation area against the true values using RMSE.
Then, for each training sample, several approaches to estimate map accuracy were tested (Figure 4):
Design-based sampling (independent probability sampling): the models are built on the training sample (350 points) and evaluated on the test points (150 points) covering the prediction area.
Random cross-validation (random CV): 10 random folds are created, and a model is built on 9 of them and evaluated on the remaining one. This is repeated 10 times.
Spatial cross-validation (spatial CV): K spatial folds are created using hierarchical clustering of the distance matrix of sampling locations. The clustering height is defined by the autocorrelation range of the response, in this case, 150 km. Then, a model is built on K-1 of them and evaluated on the remaining one. This is repeated K times.
Prediction-domain adaptive cross-validation (prediction-domain adaptive CV): 10 k-fold nearest-neighbour distance matching (kNNDM) folds are created, and a model is built on 9 of them and evaluated on the remaining one. This is repeated 10 times.
For each approach, we calculated the estimated RMSE and compared it to the Population RMSE. Additionally, for each approach we computed the area of applicability (AOA) and the Population RMSE inside the AOA.
Finally, we calculated the percentage of the prediction area that is inside the AOA as defined by the AOA threshold.
The above process was repeated 100 times for each combination of prediction scenario and training data sampling design.
4.2 Difference between estimated and true RMSE
Figure 9 shows the difference between the estimated and true RMSE for each evaluation strategy and sampling design. It shows both, the difference between the estimated RMSE and the Population RMSE, and the difference between the RMSE and the Population RMSE inside the AOA. Values close to zero indicate agreement with the Population reference, positive values indicate larger RMSE than Population, and negative values indicate smaller RMSE than Population.
Figure 9: Differences from the Population RMSE under four different sampling designs. For each evaluation strategy, boxplots show the difference in estimated RMSE. For the cross-validation methods, the difference from the Population RMSE masked to the AOA is shown additionally. The dashed line marks perfect agreement with the Population RMSE.
4.3 Area of applicability coverage
Figure 10 summarizes the percentage of the prediction domain that falls inside the area of applicability (AOA) for each evaluation strategy and sampling design. Higher values indicate that a larger fraction of the prediction domain is considered well supported by the training data under that evaluation setup.
Figure 10: Area of applicability coverage under four different sampling designs.
References
Allaire, JJ, Yihui Xie, Christophe Dervieux, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, et al. 2026. rmarkdown: Dynamic Documents for r. https://github.com/rstudio/rmarkdown.
Beygelzimer, Alina, Sham Kakadet, John Langford, Sunil Arya, David Mount, and Shengqiao Li. 2024. FNN: Fast Nearest Neighbor Search Algorithms and Applications. https://doi.org/10.32614/CRAN.package.FNN.
Coombes, Kevin R., Guy Brock, Zachary B. Abrams, and Lynne V. Abruzzo. 2019. “Polychrome: Creating and Assessing Qualitative Palettes with Many Colors.”Journal of Statistical Software, Code Snippets 90 (1): 1–23. https://doi.org/10.18637/jss.v090.c01.
Hernangómez, Diego. 2023. “Using the tidyverse with terra Objects: The tidyterra Package.”Journal of Open Source Software 8 (91): 5751. https://doi.org/10.21105/joss.05751.
Kuhn, and Max. 2008. “Building Predictive Models in r Using the Caret Package.”Journal of Statistical Software 28 (5): 1–26. https://doi.org/10.18637/jss.v028.i05.
Meyer, Hanna, Carles Milà, Marvin Ludwig, Jan Linnenbrink, and Fabian Schumacher. 2026. CAST: “caret” Applications for Spatial-Temporal Models. https://github.com/HannaMeyer/CAST.
Pebesma, Edzer. 2018. “Simple Features for R: Standardized Support for Spatial Vector Data.”The R Journal 10 (1): 439–46. https://doi.org/10.32614/RJ-2018-009.
R Core Team. 2026. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Wadoux, Alexandre M. J.-C., Gerard B. M. Heuvelink, Sytze de Bruin, and Dick J. Brus. 2021. “Spatial Cross-Validation Is Not the Right Way to Evaluate Map Accuracy.”Ecological Modelling 457: 109692. https://doi.org/https://doi.org/10.1016/j.ecolmodel.2021.109692.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.”Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC. https://yihui.org/rmarkdown/.
Xie, Yihui, Christophe Dervieux, and Emily Riederer. 2020. R Markdown Cookbook. Boca Raton, Florida: Chapman; Hall/CRC. https://yihui.org/rmarkdown-cookbook.