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

better names for tidy results from impute steps #826

Closed
EmilHvitfeldt opened this issue Oct 1, 2021 · 1 comment · Fixed by #1120
Closed

better names for tidy results from impute steps #826

EmilHvitfeldt opened this issue Oct 1, 2021 · 1 comment · Fixed by #1120
Labels
upkeep maintenance, infrastructure, and similar

Comments

@EmilHvitfeldt
Copy link
Member

The information column of the tidy method for prepped step_impute_mean(), step_impute_median(), and step_impute_mode() has the less informative name model which aligns with tidy results from step_impute_mode(). I think these could be better represented with value as is done in step_impute_lower().

library(recipes)
data("penguins", package = "modeldata")

impute_rec <- recipe( ~ ., data = penguins) %>%
  step_impute_lower(body_mass_g) %>%
  step_impute_mean(body_mass_g) %>%
  step_impute_median(body_mass_g) %>%
  step_impute_mode(island) %>%
  prep()

tidy(impute_rec, number = 1)
#> # A tibble: 1 × 3
#>   terms       value id                
#>   <chr>       <dbl> <chr>             
#> 1 body_mass_g  2700 impute_lower_9PeoD
tidy(impute_rec, number = 2)
#> # A tibble: 1 × 3
#>   terms       model id               
#>   <chr>       <dbl> <chr>            
#> 1 body_mass_g 4201. impute_mean_rmJCk
tidy(impute_rec, number = 3)
#> # A tibble: 1 × 3
#>   terms       model id                 
#>   <chr>       <dbl> <chr>              
#> 1 body_mass_g  4050 impute_median_MLNJ4
tidy(impute_rec, number = 4)
#> # A tibble: 1 × 3
#>   terms  model  id               
#>   <chr>  <chr>  <chr>            
#> 1 island Biscoe impute_mode_jJuiD
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant