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 error when passing a preprocessor with a workflow #114

Open
topepo opened this issue Jun 24, 2024 · 0 comments
Open

better error when passing a preprocessor with a workflow #114

topepo opened this issue Jun 24, 2024 · 0 comments
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@topepo
Copy link
Member

topepo commented Jun 24, 2024

Same as tidymodels/tune#912

library(tidymodels)
library(finetune)
set.seed(6735)
folds <- vfold_cv(mtcars, v = 5)

spline_rec <-
  recipe(mpg ~ ., data = mtcars) %>%
  step_spline_natural(disp, deg_free = tune("disp")) %>%
  step_spline_natural(wt, deg_free = tune("wt"))

lin_mod <-
  linear_reg() %>%
  set_engine("lm")

spline_wflow <- workflow(spline_rec, lin_mod)

spline_grid <- expand.grid(disp = 2:5, wt = 2:5)

spline_res <-
  spline_wflow %>% 
  tune_sim_anneal(spline_rec, resamples = folds)
#> Warning: The `...` are not used in this function but one or more objects were
#> passed: ''
#> Optimizing rmse
#> Initial best: 2.64170
#> 1 ◯ accept suboptimal  rmse=3.5264 (+/-0.5527)
#> 2 ◯ accept suboptimal  rmse=5.7856 (+/-0.8672)
#> 3 + better suboptimal  rmse=4.1851 (+/-0.5124)
#> 4 ─ discard suboptimal rmse=5.5377 (+/-0.7899)
#> 5 + better suboptimal  rmse=3.0792 (+/-0.4582)
#> 6 ─ discard suboptimal rmse=5.2613 (+/-0.4338)
#> 7 ─ discard suboptimal rmse=3.6311 (+/-0.5161)
#> 8 ✖ restart from best  rmse=3.0093 (+/-0.4751)
#> 9 ─ discard suboptimal rmse=3.2367 (+/-0.3523)
#> 10 ─ discard suboptimal rmse=4.3919 (+/-0.6772)

Created on 2024-06-24 with reprex v2.1.0

@topepo topepo added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jun 24, 2024
@hfrick hfrick added the feature a feature request or enhancement label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

No branches or pull requests

2 participants