Skip to content

Commit

Permalink
Update vfold.R (#471)
Browse files Browse the repository at this point in the history
* Update vfold.R

bug correction with vfold_splits function
forward on breaks value from the vfold_cv function to vfold_splits

* Add NEWS bullet

---------

Co-authored-by: Hannah Frick <hannah@posit.co>
  • Loading branch information
ZWael and hfrick committed Apr 22, 2024
1 parent 030cd48 commit a976356
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# rsample (development version)

## Bug fixes

* `vfold_cv()` now utilizes the `breaks` argument correctly for repeated cross-validation (@ZWael, #471).


# rsample 1.2.1

* `nested_cv()` no longer errors if `outside` is a long call (#459, #461).
Expand Down
2 changes: 1 addition & 1 deletion R/vfold.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ vfold_cv <- function(data, v = 10, repeats = 1,
)
}
for (i in 1:repeats) {
tmp <- vfold_splits(data = data, v = v, strata = strata, pool = pool)
tmp <- vfold_splits(data = data, v = v, strata = strata, breaks = breaks ,pool = pool)
tmp$id2 <- tmp$id
tmp$id <- names0(repeats, "Repeat")[i]
split_objs <- if (i == 1) {
Expand Down

0 comments on commit a976356

Please sign in to comment.