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

Uninformative error if wrong control_*() is used #449

Closed
EmilHvitfeldt opened this issue Feb 18, 2022 · 2 comments · Fixed by #540
Closed

Uninformative error if wrong control_*() is used #449

EmilHvitfeldt opened this issue Feb 18, 2022 · 2 comments · Fixed by #540
Labels
bug an unexpected problem or unintended behavior

Comments

@EmilHvitfeldt
Copy link
Member

See reprex below. This should be a fairly easy since since the control functions return specific classes we can check against.

library(tidymodels)

rec_no_tune_1 <-
  recipe(mpg ~ ., data = mtcars) %>%
  step_normalize(all_predictors())

set.seed(363)
mt_folds <- vfold_cv(mtcars, v = 5)

glmn_mod <- decision_tree(tree_depth = tune(), min_n = 2) %>% 
  set_mode("regression") %>%
  set_engine("rpart")

workflow() %>%
  add_recipe(rec_no_tune_1) %>%
  add_model(glmn_mod) %>%
  tune_bayes(mt_folds, control = control_grid())
#> Error in if (is.na(limit)) {: argument is of length zero

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

@EmilHvitfeldt EmilHvitfeldt added the bug an unexpected problem or unintended behavior label Feb 18, 2022
@topepo
Copy link
Member

topepo commented Sep 6, 2022

In iterative tuning methods and racing, we pass a single control function for the function (e.g. tune_sim_anneal()) and that is used to work with another function, usually tune_grid().

I think that we need a set of as_control_grid() methods that will convert from one control type to another. We’d need these to go from more complete methods to less complex. For example, we would need as_control_resamples.control_grid() but not as_control_grid.control_resamples().

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

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 Oct 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
2 participants