Comments (3)
This is a really funny bug -- the issue is that nested_cv()
is checking to see if you're passing bootstraps()
to outside
, which will trigger a warning. To check that, it deparses the value of outside
using deparse()
, which returns a character vector, then uses grepl()
to see if bootstraps
is anywhere in the actual text of the arguments you passed.
The issue is that deparse()
will break long calls into multiple elements, which causes the grepl()
call to return a vector of multiple TRUE/FALSE values, which breaks the if()
statement. So the triggering issue is that your argument to outside
is too long. You can actually sneak around this by using partial argument matching, which gets the call to outside
under the limit:
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 outside
used too many characters". Who would have thought that was a thing that could happen?
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.
from rsample.
To echo Mike here: thanks a lot for the bug report with the excellent reprex! The fix is merged into the dev version 👍
from rsample.
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.
from rsample.
Related Issues (20)
- Sorting of strata in training data from initial_split
- Grouped resampling breaks with non-missing `strata = NULL` HOT 1
- `inner_split()`: keep everything inside of `split_args` or not? HOT 1
- inner_split(): better labels
- inner_split(): S3 method to retrive splitting arguments HOT 3
- inner_split(): no initial_split() arguments HOT 2
- inner_split(): global prop argument
- Update naming for elements relating to potato set
- audit for backticked package names
- Use cli errors for `R/bootci.R`
- Use cli errors for `R/caret.R`
- Use cli errors in `R/initial_validation_split.R`
- Use cli errors in `R/labels.R`
- Use cli errors in `R/make_groups.R`, `R/mc.R`, `R/nest.R`
- Use cli errors in `R/misc.R`
- Use cli errors in `R/permutations.R`, `R/reg_intervals.R`
- Use cli errors in `R/rset.R`
- Use cli errors in `R/rsplit.R`
- Use cli errors in `R/slide.R`
- Use cli errors in `R/tidy.R`, `R/validation_set.R`, `R/vfold.R`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsample.