Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One nesting level has a single observation and throws an error #7

Open
ericpgreen opened this issue Sep 14, 2024 · 0 comments
Open

Comments

@ericpgreen
Copy link

Thanks for creating this package. I think it will be a nice shortcut for an analysis I'm working on.

I'm getting an error because one nesting level in the dataset (of 800+) only has one observation. I take it that nested_resamples() needs at least two observations. Is this right? And if so, is there a work around?

>   split <- nested_resamples(nested_df, rsample::initial_split())
Error in `purrr::map()`:
ℹ In index: 1334.
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `rsplit()`:
! At least one row should be selected for the analysis set.
Backtrace:
  1. nestedmodels::nested_resamples(nested_df, rsample::initial_split())
 11. rsample::initial_split(data = `<tibble[,20]>`)
 12. rsample::mc_cv(...)
 13. rsample:::mc_splits(...)
 14. purrr::map(indices, make_splits, data = data, class = "mc_split")
 15. purrr:::map_("list", .x, .f, ..., .progress = .progress)
 20. rsample:::make_splits.list(.x[[i]], ...)
 21. rsample:::rsplit(data, x$analysis, x$assessment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant