rsample
rsample copied to clipboard
Treat `prop` as the minimum proportion
trafficstars
If prop doesn't translate to an full number of observations to put into the training/analysis set, we currently round down. That means you can end up with a proportion of nearly prop. If we round up, we get a proportion of at least prop.
n_total <- 101
prop <- 0.8
# currently
(n_train <- floor(n_total * prop))
#> [1] 80
n_train / n_total
#> [1] 0.7920792
# proposed
(n_train <- ceiling(n_total * prop))
#> [1] 81
n_train / n_total
#> [1] 0.8019802
Created on 2022-12-06 with reprex v2.0.2
We should also document what kind of rounding is being done for the prop argument.
Yep! and check rev deps, too