tidymodels / tidymodels/spatialsample

unclear error message in `spatial_buffer_vfold_cv()`

Open
#175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
80
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I get the below purrr / rsplit error. I've tried a few values of buffer but am unsure what the error actually is in this case.

I suspect there's something wrong with the choice of buffer on this grid.

set.seed(0)
grid <- sf::st_make_grid(cellsize = c(1, 1), offset = c(0, 0), n = c(70, 100)) 

splits <-spatialsample::spatial_buffer_vfold_cv(
  sf::st_sf(grid),
  v = 5,
  buffer = 100,
  radius = NULL
)
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `rsplit()`:
! At least one row should be selected for the analysis set.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the supplied R example and start at the spatial_buffer_vfold_cv() entry point, tracing how the buffer and grid produce the rsplit() failure. Done means the same invalid or incompatible buffer situation reports a clear, actionable error instead of the generic purrr/rsplit message.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.