tidymodels / spatialsample

Create and summarize spatial resampling objects 🗺
https://spatialsample.tidymodels.org
Other
71 stars 5 forks source link

`autoplot()` does not properly handle CV with repeats #121

Closed mikemahoney218 closed 1 year ago

mikemahoney218 commented 1 year ago

On main:

library(spatialsample)

(repeated_vfold <- spatial_buffer_vfold_cv(boston_canopy, 0, 1, 2, 2))
#> #  2-fold spatial cross-validation 
#> # A tibble: 4 × 2
#>   splits           id   
#>   <list>           <chr>
#> 1 <split [19/341]> Fold1
#> 2 <split [20/341]> Fold2
#> 3 <split [16/341]> Fold3
#> 4 <split [24/341]> Fold4
autoplot(repeated_vfold)

Created on 2022-11-09 by the reprex package (v2.0.1)

On #116 :

library(spatialsample)

(repeated_vfold <- spatial_buffer_vfold_cv(boston_canopy, 0, 1, 2, 2))
#> #  2-fold spatial cross-validation 
#> # A tibble: 4 × 3
#>   splits           id      id2  
#>   <list>           <chr>   <chr>
#> 1 <split [14/341]> Repeat1 Fold1
#> 2 <split [25/341]> Repeat1 Fold2
#> 3 <split [20/341]> Repeat2 Fold1
#> 4 <split [18/341]> Repeat2 Fold2
autoplot(repeated_vfold)

Created on 2022-11-09 by the reprex package (v2.0.1)

Rather than only using id, autoplot() should use all id columns (or, potentially, facet by id and color by id2 if present)

github-actions[bot] commented 1 year ago

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.