You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #145
I think there's a bug when passing a polygon as prediction_sites to spatial_nndm_cv. When I use a single single sfc_POLYGON, the assessment folds do not have any buffer around them -- the CV just becomes a LOOCV. When I pass a sfc_POINT object sampled from the same sfc_POLYGON, the NNDM has folds as expected.
Wrapping the sfc_POLYGON in a call to st_sample is of course a very easy workaround, but the documentation clearly states the desired behavior for a single polygon.
Having looked quickly at the source code, it seems to me that sample_points is not being carried forward as the prediction_sites (unless it lacks a CRS).
The problem
Related to #145
I think there's a bug when passing a polygon as
prediction_sites
tospatial_nndm_cv
. When I use a single single sfc_POLYGON, the assessment folds do not have any buffer around them -- the CV just becomes a LOOCV. When I pass a sfc_POINT object sampled from the same sfc_POLYGON, the NNDM has folds as expected.Wrapping the sfc_POLYGON in a call to
st_sample
is of course a very easy workaround, but the documentation clearly states the desired behavior for a single polygon.Having looked quickly at the source code, it seems to me that
sample_points
is not being carried forward as theprediction_sites
(unless it lacks a CRS).spatialsample/R/spatial_nndm_cv.R
Line 131 in 9877514
Reproducible example
Created on 2024-08-27 with reprex v2.1.1
Session info
The text was updated successfully, but these errors were encountered: