-
Notifications
You must be signed in to change notification settings - Fork 66
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
Odd error when combining nested_cv
and sliding_period
#459
Comments
deparse1() was added in 4.0.0, so copied the internals for back-compatibility.
This is a really funny bug -- the issue is that The issue is that library(tidyverse)
library(rsample)
library(modeldata)
data(Chicago)
nested_cv(Chicago,
outside = sliding_period(i = date,
p = "month",
origin = Chicago$date[1]),
inside = vfold_cv(v = 4)
)
#> # Nested resampling:
#> # outer: Sliding period resampling
#> # inner: 4-fold cross-validation
#> # A tibble: 187 × 3
#> splits id inner_resamples
#> <list> <chr> <list>
#> 1 <split [10/28]> Slice001 <vfold [4 × 2]>
#> 2 <split [28/31]> Slice002 <vfold [4 × 2]>
#> 3 <split [31/30]> Slice003 <vfold [4 × 2]>
#> 4 <split [30/31]> Slice004 <vfold [4 × 2]>
#> 5 <split [31/30]> Slice005 <vfold [4 × 2]>
#> 6 <split [30/31]> Slice006 <vfold [4 × 2]>
#> 7 <split [31/31]> Slice007 <vfold [4 × 2]>
#> 8 <split [31/30]> Slice008 <vfold [4 × 2]>
#> 9 <split [30/31]> Slice009 <vfold [4 × 2]>
#> 10 <split [31/30]> Slice010 <vfold [4 × 2]>
#> # ℹ 177 more rows Created on 2023-11-02 with reprex v2.0.2 To be clear, this is a bug and I opened #461 to fix it. I just think it's very funny that this bug winds up being "the argument to Thanks for the excellent, excellent reprex -- made it so I could immediately see what was wrong, and I've stolen your example for #461 as a test to make sure this gets & stays fixed. |
To echo Mike here: thanks a lot for the bug report with the excellent reprex! The fix is merged into the dev version 👍 |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
The problem
I'm having trouble when combining
sliding_period
withnested_cv
, in particular if I specify theorigin
argument together withlookback
(even with its default value).The error is the following
Here a reproducible example:
The text was updated successfully, but these errors were encountered: