Skip to content

Add repeat argument to spatial_block_cv() #122

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

Merged
merged 2 commits into from
Nov 18, 2022
Merged

Conversation

mikemahoney218
Copy link
Member

This PR fixes #117 by adding a repeats argument to spatial_block_cv().

I've added the argument after ..., because I want to add it after v for consistency, but don't know if this merits a breaking change. The argument goes after v in rsample and spatial_buffer_vfold_cv(), but doing so here would be breaking for the other four functions in spatialsample.

library(spatialsample)

spatial_block_cv(
  boston_canopy,
  v = 2,
  repeats = 2
)
#> #  2-fold spatial block cross-validation 
#> # A tibble: 4 × 3
#>   splits            id      id2  
#>   <list>            <chr>   <chr>
#> 1 <split [363/319]> Repeat1 Fold1
#> 2 <split [319/363]> Repeat1 Fold2
#> 3 <split [340/342]> Repeat2 Fold1
#> 4 <split [342/340]> Repeat2 Fold2

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

@mikemahoney218 mikemahoney218 requested a review from hfrick November 9, 2022 14:39
Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placement of the repeats arg makes sense to me

@mikemahoney218 mikemahoney218 merged commit 9b702af into main Nov 18, 2022
@mikemahoney218 mikemahoney218 deleted the repeat_block branch November 18, 2022 16:53
@github-actions
Copy link

github-actions bot commented Dec 3, 2022

This pull request 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.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spatial_block_cv() should have a repeats argument
2 participants