Prevent LOO through vfold_cv()#527
Merged
Merged
Conversation
vfold_cv() throws an error, if used for leave-one-out cross-validation, refering to loo_cv() instead. Fixes tidymodels#440
Member
|
@seb09 Thanks a bunch for the PR! I'm just dropping in quickly to say that I'm OOO until the week after next but will get to this after my return. |
Contributor
Author
|
Enjoy your time off 🙂 |
- use cli - thread call through - keep error for repeated CV
for symmetry with the lower bound for `v`
hfrick
reviewed
Sep 9, 2024
| strata_check(strata, data) | ||
| check_repeats(repeats) | ||
|
|
||
| if (isTRUE(v == nrow(data))) { |
Comment on lines
+15
to
+17
| #' @param v The number of partitions of the data set. Should be an integer | ||
| #' smaller than `nrow(data)`. If you want to create a split for a leave-one-out | ||
| #' cross-validation (`v = nrow(data)`), please use [loo_cv()] instead. |
Member
There was a problem hiding this comment.
We also require a few other things of v, e.g. to be larger than 1 and don't mention it all here. We could move it to the Details section but I think it's okay to let users bump into the error for the edgecases so that we can keep their focus on more high-level aspects.
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vfold_cv() throws an error, if used for leave-one-out cross-validation, refering to loo_cv() instead. Fixes #440