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

Create apparent() via new_rset() #223

Merged
merged 3 commits into from Feb 24, 2021
Merged

Create apparent() via new_rset() #223

merged 3 commits into from Feb 24, 2021

Conversation

juliasilge
Copy link
Member

This PR closes #190 by creating an apparent() resample via new_rset(), which means there is now a label:

library(rsample)

car_samp <- apparent(mtcars)
split1 <- car_samp$splits[[1]]
labels(split1)
#> # A tibble: 1 x 1
#>   id      
#>   <chr>   
#> 1 Apparent

Created on 2021-02-19 by the reprex package (v1.0.0)

This means that tuning/etc now works:

library(tidymodels)

set.seed(234)
workflow() %>%
  add_model(linear_reg() %>% set_engine("lm")) %>%
  add_recipe(recipe(mpg ~ hp, data = mtcars)) %>%
  tune_grid(resamples = apparent(mtcars))
#> Warning: No tuning parameters have been detected, performance will be evaluated
#> using the resamples with no tuning. Did you want to [tune()] parameters?
#> # Tuning results
#> # Apparent sampling 
#> # A tibble: 1 x 4
#>   splits          id       .metrics         .notes          
#>   <list>          <chr>    <list>           <list>          
#> 1 <split [32/32]> Apparent <tibble [2 × 4]> <tibble [0 × 1]>

Created on 2021-02-19 by the reprex package (v1.0.0)

Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🙌

@juliasilge juliasilge merged commit ddd68da into master Feb 24, 2021
@juliasilge juliasilge deleted the apparent-rset branch February 24, 2021 16:42
@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 Mar 11, 2021
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.

rsample::apparent does not work in tune_grid
2 participants