Skip to content
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

Treat prop as the minimum proportion #396

Open
hfrick opened this issue Dec 6, 2022 · 2 comments
Open

Treat prop as the minimum proportion #396

hfrick opened this issue Dec 6, 2022 · 2 comments
Labels
feature a feature request or enhancement

Comments

@hfrick
Copy link
Member

hfrick commented Dec 6, 2022

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

@EmilHvitfeldt
Copy link
Member

We should also document what kind of rounding is being done for the prop argument.

@hfrick
Copy link
Member Author

hfrick commented Dec 7, 2022

Yep! and check rev deps, too

@hfrick hfrick added the feature a feature request or enhancement label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants