Create and summarize spatial resampling objects 🗺
R
spatialsample provides spatial resampling methods for cross-validation with the rsample package. It implements spatial clustering, spatial block, buffered, and leave-location-out cross-validation strategies designed specifically for spatial data.
Standard cross-validation can fail with spatial data because nearby observations are often similar, leading to overly optimistic performance estimates. spatialsample addresses this by creating resampling folds that account for spatial structure, ensuring training and test sets are spatially separated. The package integrates with the tidymodels ecosystem and includes visualization tools for examining fold assignments on maps.