Closed mikemahoney218 closed 2 years ago
cc @juliasilge @hfrick
We also special-case NULL
already for spatial_leave_location_out_cv
, because it just wraps group_vfold_cv
and so does what rsample does.
Another possibility is to special-case both NULL
and Inf
, which I think I'd personally prefer over just NULL
(just because Inf
feels so graceful). Not a strong preference, but definitely a preference.
I like your idea of special-casing both NULL
and Inf
. (I do think that NULL
will be more familiar to folks.) I'd also do a check through the examples and (if possible due to time constraints on the check) show using this.
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.
Feature
spatialsample uses a different check_v than rsample, because it's often the case that setting v to max_v makes statistical sense (in situations like leave-one-block-out CV, leave-one-location-out CV, and so on). However, it can be difficult to know in advance what
v
should be for these circumstances, for instance to know how many blocks will contain data in the process of running spatial_block_cv. Right now, my general approach is to setv = Inf
, which works with a warning:Created on 2022-06-22 by the reprex package (v2.0.1)
I think this makes good, intuitive sense, and gives the expected result: we're setting
v
higher than the maximum acceptable number of folds and gettingmax_v
instead, and by settingv
to infinity we can be sure it's higher than that maximum. I think we shouldn't warn whenis.infinite(v)
and document this as the supported way to perform leave-one-something-out CV.An alternative would be to use
NULL
for this special case, which is how rsample does it in group vfold and might be a more normal "special case" value than Inf, which I bet a good chunk of users are barely aware of in the first place. Right now this errors:Created on 2022-06-22 by the reprex package (v2.0.1)
NULL
feels less graceful to me for this purpose thanInf
, but might be more idiomatic.