kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation
Open accessPublished version of a preprint
The DOI matches its Crossref record; 42 of the 43 references it cites were found in a registry or an index; 14 of the 23 sources its claims cite were checked for support.
Abstract
Random and spatial cross-validation (CV) methods are commonly used to evaluate machine-learning-based spatial prediction models, and the performance values obtained are often interpreted as map accuracy estimates. However, the appropriateness of such approaches is currently the subject of controversy. For the common case where no probability sample for validation purposes is available, in Milà et al. (2022) we proposed the nearest-neighbour distance matching (NNDM) leave-one-out (LOO) CV method. This method produces a distribution of geographical nearest-neighbour distances (NNDs) between test and training locations during CV that matches the distribution of NNDs between prediction and training locations. Hence, it creates predictive conditions during CV that are comparable to what is required when predicting a defined area. Although NNDM LOO CV produced largely reliable map accuracy estimates in our analysis, as a LOO-based method, it cannot be applied to the large datasets found in many studies. Here, we propose a novel k -fold CV strategy for map accuracy estimation inspired by the concepts of NNDM LOO CV: the k -fold NNDM (kNNDM) CV. The kNNDM algorithm tries to find a k -fold configuration such that the empirical cumulative distribution function (ECDF) of NNDs between test and training locations during CV is matched to the ECDF of NNDs between prediction and training locations. We tested kNNDM CV in a simulation study with different sampling distributions and compared it to other CV methods including NNDM LOO CV. We found that kNNDM CV performed similarly to NNDM LOO CV and produced reasonably reliable map accuracy estimates across sampling patterns. However, compared to NNDM LOO CV, kNNDM resulted in significantly reduced computation times. In an experiment using 4000 strongly clustered training points, kNNDM CV reduced the time spent on fold assignment and model training from 4.8 d to 1.2 min. Furthermore, we found a positive association between the quality of the match of the two ECDFs in kNNDM and the reliability of the map accuracy estimates. kNNDM provided the advantages of our original NNDM LOO CV strategy while bypassing its sample size limitations.
Overview
CoChat Summary
TL;DR
The paper introduces kNNDM CV, a k-fold nearest-neighbour distance matching cross-validation method for map accuracy estimation that extends NNDM LOO CV to larger datasets. In simulations, kNNDM performed similarly to NNDM LOO CV and produced reasonably reliable map accuracy estimates across sampling patterns while greatly reducing computation time.
Key findings
- kNNDM CV yielded reliable error estimates across all sampling patterns considered, similar to and sometimes more accurate than NNDM LOO CV; random 10-fold CV was reliable under random sampling but failed for clustered data, while spatial 10-fold CV overestimated mapping error except for RMSE in the strong clustering scenario and had the largest variability.
- For 4000 strongly clustered training points, kNNDM CV reduced time spent on fold assignment and model training from 4.8 d to 1.2 min compared with NNDM LOO CV; for random samples, it reduced this from 3.2 h to 30 s.
- The quality of the match between NND ECDFs, measured by the Wasserstein statistic \(W\), was positively associated with the quality of map accuracy estimates; in the first simulation this relationship was linear with at least 60 % explained variance, with regression \(R^2\) values of 0.66, 0.6, and 0.73 for RMSE, \(R^2\), and MAE, respectively.
- Larger numbers of folds gave better matches for regular and random samples, but for strongly clustered designs \(k=2\) was overly pessimistic and \(k=4\) or 6 performed better.
Methods
- The kNNDM algorithm seeks a k-fold configuration whose empirical cumulative distribution function of nearest-neighbour distances between test and training locations during CV matches the ECDF of nearest-neighbour distances between prediction and training locations; it uses clustering to create candidate fold configurations and selects the one minimizing the Wasserstein statistic \(W\), after a one-sided Kolmogorov–Smirnov test for clustering.
- Simulation 1 used a virtual response surface for the Iberian Peninsula generated from WorldClim bioclimatic variables and the virtualspecies R package, with five sampling distributions and sample size 100; 100 iterations produced 500 fitted random forest models, and CV methods compared were random 10-fold CV, spatial 10-fold CV via k-means, NNDM LOO CV, and 10-fold kNNDM CV, evaluated with RMSE, MAE, and \(R^2\).
- An additional simulation modelled above-ground biomass in Europe using 22 predictors and 5000 sample points across five sampling designs, comparing random 10-fold CV, spatial 10-fold CV, and 10-fold kNNDM CV; a run-time analysis used sample sizes from 100 to 4000 training points for strongly clustered and random designs.
Limitations
- The paper states that kNNDM has lower flexibility than NNDM LOO CV because every observation must be assigned to a fold; matching may be impossible if the range of prediction NNDs differs from the range of training NNDs, especially under complete model transfer, so inspection of NND ECDFs is recommended.
- The paper states that kNNDM may still fail to match predictive conditions for very clustered training data, and recommends allowing a greater maximum fold size, using a lower fold number \(k\), or restricting the prediction area to the area of applicability; it also notes that NNDM-based methods are purely geographical, ignore feature space, do not address slight error overestimation for regular samples, ignore location/direction of distances, require the prediction area not to change, and cannot be used when the prediction area is unknown.
- The text makes evident that the \(W\)-accuracy relationship was weaker in the second, continental-scale simulation, where \(W\) explained only 28 % of the variance in absolute RMSE differences, and kNNDM gave overly optimistic estimates in the strongly clustered design; this suggests other factors such as feature-space distances may matter.
Model-written summary. Check it against the paper before relying on it.
Integrity signals
Registry
Cites
Statistics
Figures



![Figure 4 Data used in the simulation: (a) bioclimatic covariates and response (all linearly stretched to [0 ; 1] for visualisation purposes) and (b) an example of one iteration of the sample simulation. Figure reproduced from Milà et al. (2022).](https://figures.cochat.ai/paper-figures/51734e6bdf99457aaf490a2ed482c8ce/knndm-cv-i-k-i-fold-nearest-neighbour-distance-matching-cross-validation-for-map-figure-4.png)




![Figure A1. Data used in the AGB simulation. Panel (a) shows a subset of the 22 predictors, as well as the response raster. Rasters were linearly stretched to [0 ; 1] for visualisation purposes. Panel (b) shows one iteration of the different sampling designs. Data from de Bruin et al. (2022).](https://figures.cochat.ai/paper-figures/4eb736e02c104d299ef035032ce65122/knndm-cv-i-k-i-fold-nearest-neighbour-distance-matching-cross-validation-for-map-figure-9.png)
![Figure A2. Differences between cross-validated and true RMSE; 'kNNDM [tuned]' refers to the kNNDM split that yielded the lowest W statistic among different numbers of folds k 2 f 2 ; 4 ; 6 ; : : :; 20 g .](https://figures.cochat.ai/paper-figures/41b41ba43c1a471387f10438001d3754/knndm-cv-i-k-i-fold-nearest-neighbour-distance-matching-cross-validation-for-map-figure-10.png)


Verification
Claims the paper makes
8 Valid · 1 Not valid · 4 Not checked · 57 Own results and interpretations
Every source the paper cites for this claim was checked and supports it.
In the paper
“In Milà et al. (2022) we showed that when standard LOO CV is used for reference data randomly distributed within the prediction area, the distribution of NNDs between test and training locations during CV is similar to the distribution of NNDs between prediction and training locations (see Meyer and Pebesma, 2022, for similar results for random kfold CV).”
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > 1 Introduction
What the sources say
- Supportedcites Milà et al., 2022 matched to “Nearest neighbour distance matching Leave‐One‐Out Cross‐Validation for map validation” (2022) source
Split into 2 atoms — 2 confirmed, 0 partially supported, 0 disputed, 0 misattributed, 0 unverifiable. Expand the claim to see per-atom verdicts.
- Supportedcites Meyer and Pebesma, 2022 matched to “Machine learning-based global maps of ecological variables and the challenge of assessing them” (2022) source
Split into 2 atoms — 2 confirmed, 0 partially supported, 0 disputed, 0 misattributed, 0 unverifiable. Expand the claim to see per-atom verdicts.
plain- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
- Supported
The cited sources support only part of this claim — read each source’s verdict below.
In the paper
“If the null hypothesis is not rejected, the algorithm returns a random kfold CV, since it is the appropriate option for random and regular samples (Meyer and Pebesma, 2022;Wadoux et al., 2021;de Bruin et al., 2022).”
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > 2 Algorithm description
What the sources say
- Partly supportedcites Meyer and Pebesma, 2022 matched to “Machine learning-based global maps of ecological variables and the challenge of assessing them” (2022) sourceExperimental — accuracy not yet measured
The “Map quality: global or local assessment?” section says random n-fold cross-validation makes sense when data are independent and identically distributed, as can occur with completely spatially random sampling. It does not say that failing to reject a null hypothesis of no clustering establishes that condition, or that random k-fold cross-validation is appropriate for regular samples. Page numbers were not available in our copy. (LLM, conf=0.84)
- Not checked — no full text of the sourcecites Wadoux et al., 2021 matched to “Spatial cross-validation is not the right way to evaluate map accuracy” (2021) source
- Partly supportedcites de Bruin et al., 2022 matched to “Dealing with clustered samples for assessing map accuracy by cross-validation” (2022) sourceExperimental — accuracy not yet measured
The Introduction says conventional k-fold CV likely produces reasonable results when points are fairly uniformly distributed, and Section 3.4 reports that random CV performed close to reference values for simple random and systematic random samples. The paper does not describe a null-hypothesis test for clustering or say that failure to reject it should trigger an algorithm to return random k-fold CV. (LLM, conf=0.84)
plainstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
- Partly supported
The sources with a verdict support this claim; the rest weren’t checked yet, have no full text we could read, or their verdicts aren’t rated yet.
In the paper
“Also in agreement with other studies, we found that spatial CV methods that do not take into account the geographical prediction space tended to be overly pessimistic even with clustered samples within the prediction area (Wadoux et al., 2021;de Bruin et al., 2022;Milà et al., 2022), for example as a result of block sizes that do not match the prediction task.”
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > 4 Discussion
What the sources say
- Not checked — no full text of the sourcecites Wadoux et al., 2021 matched to “Spatial cross-validation is not the right way to evaluate map accuracy” (2021) source
- Supportedcites de Bruin et al., 2022 matched to “Dealing with clustered samples for assessing map accuracy by cross-validation” (2022) source
The Introduction says spatial cross-validation ignores that many prediction points are close to calibration points and therefore tends to give overly pessimistic results. Section 3.4 reports this bias across the tested designs, including clustered designs without gaps; the Conclusions qualify that blocked spatial cross-validation was closest to the reference for a strongly clustered design with large gaps. (LLM, conf=0.91)
- Supportedcites Milà et al., 2022 matched to “Nearest neighbour distance matching Leave‐One‐Out Cross‐Validation for map validation” (2022) source
The Introduction (page unavailable) says spatial CV may overestimate errors even with clustered samples and argues that the geographical prediction space matters. In the Simulation 2 discussion (page unavailable), the authors report that bLOO, a spatial CV method that does not account for the prediction area, mostly overestimated prediction errors in spatial interpolation problems. (LLM, conf=0.90)
plainstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
The cited sources that could be checked couldn’t confirm or dispute this claim.
In the paper
“the amount of bias expected with two folds due to large parts of the training data being left out is expected to be large (Kohavi, 1995)”
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > 4 Discussion
What the sources say
- Could not verifycites Kohavi, 1995 matched to “A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection” (1995) sourceExperimental — accuracy not yet measured
The available text from the Introduction says the study varies the number of cross-validation folds, but it does not discuss the expected bias of two-fold validation or attribute that bias to leaving out training data. Searches for two-fold validation and small training sets returned no decisive passage; the accessible paper text cuts off near the start of Section 2, so the relevant discussion may be missing. (LLM, conf=0.72)
hedgedstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
- Could not verify
The cited sources support only part of this claim — read each source’s verdict below.
In the paper
“As shown in Meyer and Pebesma (2022), when samples are randomly distributed within the prediction area, the distribution of NNDs during the random 10-fold CV Ĝ * j (r, L) resembles the distribution of NNDs during prediction Ĝij (r), and therefore the value of W is small.”
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > 2 Algorithm description
What the sources say
- Partly supportedcites Meyer and Pebesma, 2022 matched to “Machine learning-based global maps of ecological variables and the challenge of assessing them” (2022) sourceExperimental — accuracy not yet measured
The “Map quality: global or local assessment?” section says cross-validation prediction situations naturally resemble map-prediction situations when reference data are sampled completely at random. Figure 1 in “Global reference data used in machine learning applications” compares nearest-neighbor distance distributions for a simulated spatially random sample. The paper does not specify random 10-fold cross-validation or define and report a small value of W. (LLM, conf=0.83)
plainstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
- Partly supported
33 more claims
Create a free account to see all 70 claims and every source verdict.
- It may state two separate claims as one. 25
- Probably not a substantial claim. 8
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
Each contradiction between two passages listed here was confirmed by an independent check.
Rated minor: it would not touch a result — a value no result rests on, a p-value that stays on the same side of the significance level, or a conflict that is clerical, resolved elsewhere in the paper, or outside its own findings.
In the paper
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > Appendix A: Additional simulation study
“We did not include NNDM LOO CV, since it was computationally not feasible (see Fig. 7 in the main paper for a run-time analysis).”
§ Methods for assessment of models kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation > Appendix A: Additional simulation study
“Figure: 7 Figure 7 . Figure 7. CV error estimates for kNNDM CV with different values of k (first three rows).The respective W statistic is shown in the fourth row.”
Citations
Cites
The Elements of Statistical Learning
Hastie, T., Tibshirani, R., & Friedman, J. (2009) · Springer Series in Statistics · doi:10.1007/978-0-387-84858-7 · Cited by 25,970 · cited 1×
“Traditional CV methods that ignore the spatial structure of the data such as leave-one-out (LOO) or random k -fold CV (Hastie et al., 2009) have been found to provide reliable estimates of map accuracy when samples are randomly distributed within the entire prediction area but not when they are…”
Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L., François, R., Grolemund, G., Hayes, A., Henry, L., Hester, J., et al. (2019) · Journal of Open Source Software · doi:10.21105/joss.01686 · Cited by 22,138
ggplot2: Elegant Graphics for Data Analysis
Ginestet, C. (2011) · Journal of the Royal Statistical Society Series A: Statistics in Society · doi:10.1111/j.1467-985x.2010.00676_9.x · Cited by 13,726
The Elements of Statistical Learning: Data Mining, Inference, and Prediction
John Lu, Z. Q. (2010) · Journal of the Royal Statistical Society Series A: Statistics in Society · doi:10.1111/j.1467-985x.2010.00646_6.x · Cited by 12,390
A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection
Kohavi, R. (1995) · Zenodo · doi:10.5281/zenodo.19712698 · Cited by 10,909
SoilGrids250m: Global gridded soil information based on machine learning
Hengl, T., Mendes de Jesus, J., Heuvelink, G. B. M., Ruiperez Gonzalez, M., Kilibarda, M., Blagotić, A., Shangguan, W., Wright, M. N., Geng, X., Bauer-Marschallinger, B., et al. (2017) · PLOS ONE · doi:10.1371/journal.pone.0169748 · Cited by 4,733
Simple Features for R: Standardized Support for Spatial Vector Data
Pebesma, E. (2018) · The R Journal · doi:10.32614/rj-2018-009 · Cited by 4,701
Cross‐validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure
Roberts, D. R., Bahn, V., Ciuti, S., Boyce, M. S., Elith, J., Guillera‐Arroita, G., Hauenstein, S., Lahoz‐Monfort, J. J., Schröder, B., Thuiller, W., et al. (2017) · Ecography · doi:10.1111/ecog.02881 · Cited by 3,689 · cited 5×
“…CV methods are designed for geographical model trans-ferability assessment, i.e. to test the ability of the model to make predictions for new geographic entities far away from the sampling areas by designing a CV where independence between training and test data is sought (Roberts et al., 2017 .”
MethodInfluentialGeostatistics for Environmental Scientists
Webster, R., & Oliver, M. A. (2007) · Wiley eBooks · doi:10.1002/9780470517277 · Cited by 2,345
caret: Classification and Regression Training
Kuhn, M. (2007) · CRAN: Contributed Packages · doi:10.32614/cran.package.caret · Cited by 1,786
Cited by
Soil carbon in the world’s tidal marshes
Maxwell, T. L., Spalding, M. D., Friess, D. A., Murray, N., Rogers, K., Rovai, A., Smart, L. S., Weilguny, L., Adame, M. F., Adams, J. B., et al. (2024) · Nature Communications · doi:10.1038/s41467-024-54572-9 · Cited by 110
“We used the k-fold Nearest Neighbour Distance Matching (k-NNDM) Cross-Validation presented by Linnenbrink et al. 2023 276 and implemented within the CAST package (0.8.1) 277 , which is a variant of the leave-one-out NNDM cross validation with reduced computation time compared to the method…”
InfluentialSelf-citationGlobal hotspots of mycorrhizal fungal richness are poorly protected
Nuland, M. E. V., Averill, C., Stewart, J. D., Prylutskyi, O., Corrales, A., van Galen, L. G., Manley, B. F., Qin, C., Lauber, T., Mikryukov, V. S., et al. (2025) · Nature · doi:10.1038/s41586-025-09277-4 · Cited by 105
“To account for the possibility that geographically uneven sampling efforts affect fungal species prevalence scores and biases predictions of fungal endemism, we simulated a global high-sampling scenario for rarity spatial models (see below).”
Aramburu-Merlos, F., Tenorio, F. A., Mashingaidze, N., Sananka, A., Aston, S., Ojeda, J. J., & Grassini, P. (2024) · Nature Communications · doi:10.1038/s41467-024-48859-0 · Cited by 90
“To avoid over fi tting the GBM model to our data regions, we tuned the model by selecting the parameters that resulted in the lowest spatial cross-validation errors by splitting the data into training and testing subsets with the k-fold nearest neighbor distance matching algorithm 73 .”
Random forests with spatial proxies for environmental modelling: opportunities and pitfalls
Milà, C., Ludwig, M., Pebesma, E. J., Tonne, C. C., & Meyer, H. (2024) · Geoscientific model development · doi:10.5194/gmd-17-6007-2024 · Cited by 76
“…(Hijmans, 2022) for spatial-data management; caret (Kuhn, 2022), ranger (Wright and Ziegler, 2017), RandomForestsGLS (Saha et al., 2022), and CAST (Meyer et al., 2023) for spatial modelling; gstat (Pebesma, 2004) for random-field simulation; and ggplot2 (Wick-ham, 2016) and tmap (Tennekes, 2018)…”
InfluentialSelf-citationCAST: 'caret' Applications for Spatial-Temporal Models
Meyer, H., Milà, C., Ludwig, M., Linnenbrink, J., & Schumacher, F. (2018) · doi:10.32614/cran.package.cast · Cited by 56
Self-citation
Metadata
- Authors
- Linnenbrink, J., Milà, C., Ludwig, M., & Meyer, H.
- Affiliations
- University of Münster (DE)
- Universitat Pompeu Fabra (ES)
- Corresponding author
- Linnenbrink, Jan
- Venue
- Geoscientific Model Development
- Publisher
- Copernicus GmbH
- Published
- 2024-08-07
- Volume
- 17
- Issue
- 15
- Pages
- 5897-5912
- ISSN
- 1991-959X (ISSN-L)
- 1991-9603
- OpenAlex
- W4401399092
- Semantic Scholar
- 08811371dcc715cc7351fcb5bb27a3eea753ba86
- Cited by
- 82
- References
- 32
- Citations by year
- 2026: 45 · 2025: 28 · 2024: 9
- FWCI
- 22.15
- Type
- journal article
- Language
- en
- Open access
- gold
- doi.org
- Licence
- Locations
- Geoscientific model development (publishedVersion, cc-by)
- Repositori digital de la UPF (Universitat Pompeu Fabra) (acceptedVersion, other-oa)
- DOAJ (DOAJ: Directory of Open Access Journals) (submittedVersion)
- Funders
- Bundesministerium für Wirtschaft und Klimaschutz
- Westfälische Wilhelms-Universität Münster
- Topics
- Social Sciences › Economics, Econometrics and Finance › Economics and Econometrics › Spatial and Panel Data Analysis
- Life Sciences › Agricultural and Biological Sciences › Soil Science › Soil Geostatistics and Mapping
- Physical Sciences › Environmental Science › Ecological Modeling › Species Distribution and Climate Change
- Keywords
- k-fold cross-validation, spatial cross-validation, leave-one-out cross-validation, spatial prediction models, computational efficiency
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
The claim verdicts this report counts are experimental: their accuracy is not yet measured.
A language model drew the claims from the paper on 2026-10-15, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).
A second model labelled each claim on 2026-10-15 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).
Cited sources are checked with a language model’s help (gpt-6-sol).
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
How to cite
Cite CoChat for the checks on this page, and the paper for its own findings.
- This page
- CoChat. (2026). Citation check: kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation. https://app.cochat.ai/papers/10.5194/gmd-17-5897-2024
- The paper
- Linnenbrink, J., Milà, C., Ludwig, M., & Meyer, H. (2024). kNNDM CV: k-fold nearest-neighbour distance matching cross-validation for map accuracy estimation. Geoscientific Model Development. https://doi.org/10.5194/gmd-17-5897-2024
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.