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

Warn when bootstraps returns the apparent #357

Merged
merged 1 commit into from
Aug 8, 2022
Merged

Warn when bootstraps returns the apparent #357

merged 1 commit into from
Aug 8, 2022

Conversation

mikemahoney218
Copy link
Member

Fixes #356

library(rsample)

bootstraps(mtcars[1, ])
#> Warning in bootstraps(mtcars[1, ]): Some assessment sets contained zero rows.
#> # Bootstrap sampling 
#> # A tibble: 25 × 2
#>    splits        id         
#>    <list>        <chr>      
#>  1 <split [1/0]> Bootstrap01
#>  2 <split [1/0]> Bootstrap02
#>  3 <split [1/0]> Bootstrap03
#>  4 <split [1/0]> Bootstrap04
#>  5 <split [1/0]> Bootstrap05
#>  6 <split [1/0]> Bootstrap06
#>  7 <split [1/0]> Bootstrap07
#>  8 <split [1/0]> Bootstrap08
#>  9 <split [1/0]> Bootstrap09
#> 10 <split [1/0]> Bootstrap10
#> # … with 15 more rows
#> # ℹ Use `print(n = ...)` to see more rows
group_bootstraps(mtcars, cyl)
#> Warning in group_bootstraps(mtcars, cyl): Some assessment sets contained zero rows.
#> ℹ Consider using a non-grouped resampling method.
#> # Group bootstrap sampling 
#> # A tibble: 25 × 2
#>    splits          id         
#>    <list>          <chr>      
#>  1 <split [36/7]>  Bootstrap01
#>  2 <split [35/11]> Bootstrap02
#>  3 <split [36/7]>  Bootstrap03
#>  4 <split [35/11]> Bootstrap04
#>  5 <split [33/21]> Bootstrap05
#>  6 <split [39/7]>  Bootstrap06
#>  7 <split [28/11]> Bootstrap07
#>  8 <split [29/14]> Bootstrap08
#>  9 <split [29/14]> Bootstrap09
#> 10 <split [36/7]>  Bootstrap10
#> # … with 15 more rows
#> # ℹ Use `print(n = ...)` to see more rows

Created on 2022-08-08 by the reprex package (v2.0.1)

@mikemahoney218 mikemahoney218 marked this pull request as ready for review August 8, 2022 18:00
@mikemahoney218 mikemahoney218 requested review from juliasilge and hfrick and removed request for juliasilge August 8, 2022 18:00
@mikemahoney218
Copy link
Member Author

GitHub really hates when I request two reviews 🤦

Copy link
Member

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 🙌

@juliasilge juliasilge merged commit 761d330 into main Aug 8, 2022
@juliasilge juliasilge deleted the mike/356 branch August 8, 2022 18:51
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

group_bootstraps() errors when it gets original dataset in a resample
2 participants