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

tune_args.recipe doesn't include un-tunable arguments marked for tuning #1296

Open
simonpcouch opened this issue Apr 3, 2024 · 0 comments
Open
Labels
bug an unexpected problem or unintended behavior

Comments

@simonpcouch
Copy link
Contributor

Related to tidymodels/tune#660. It looks like, currently, tune_args() doesn't include arguments marked for tuning if they're not tunable.

library(tidymodels)

rec <- 
  recipe(Price ~ ., data = credit_data) %>%
  step_impute_bag(
    Status, Home, Marital, Job, Income, Assets, Debt,
    # tunable
    trees = tune(),
    # not known tunable
    options = tune()
  )

credit_wflow <- workflow(rec, linear_reg())

# correct - we only have parameter info for trees
tunable(credit_wflow)
#> # A tibble: 1 × 5
#>   name  call_info        source component       component_id    
#>   <chr> <list>           <chr>  <chr>           <chr>           
#> 1 trees <named list [3]> recipe step_impute_bag impute_bag_EUEU7

# incorrect - doesn't include `options` from recipe
tune_args(credit_wflow)
#> # A tibble: 1 × 6
#>   name  tunable id    source component       component_id    
#>   <chr> <lgl>   <chr> <chr>  <chr>           <chr>           
#> 1 trees TRUE    trees recipe step_impute_bag impute_bag_EUEU7

Created on 2024-04-03 with reprex v2.1.0

@simonpcouch simonpcouch added the bug an unexpected problem or unintended behavior label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant