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

save_workflow = FALSE not removing warning about the workflow being saved with tune_sim_anneal #122

Open
kevbaer opened this issue Mar 11, 2025 · 0 comments

Comments

@kevbaer
Copy link

kevbaer commented Mar 11, 2025

The problem

Hey! Hope you are having a good day. I'm having trouble with removing the warning message:

The workflow being saved contains a recipe, which is 9.66 Mb in
memory. If this was not intentional, please set the control
setting save_workflow = FALSE.

Even though I do have save_workflow = FALSE in my control.

Reproducible example

library(reprex)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(readr)
library(parsnip)
library(recipes)
#> 
#> Attaching package: 'recipes'
#> The following object is masked from 'package:stats':
#> 
#>     step
library(rsample)
library(tune)
library(workflowsets)
library(finetune)


set.seed(1)

jj <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-05-09/childcare_costs.csv") |>
  na.omit()
#> Rows: 34567 Columns: 61
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (61): county_fips_code, study_year, unr_16, funr_16, munr_16, unr_20to64...
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

data_split <- jj |>
  initial_split()

train <- training(data_split)
folds <- vfold_cv(train, v = 3)

xgb_rec <-
  recipe(mcsa ~ ., data = train)

xgb_spec <-
  boost_tree(
    tree_depth = tune()
  ) |>
  set_engine("xgboost") |>
  set_mode("regression")

set <-
  workflow_set(
    preproc = list(rec = xgb_rec),
    models = list(boosting = xgb_spec)
    )

sim_ctrl <-
  control_sim_anneal(
    save_workflow = FALSE
    )


sim_results <-
  set |>
  workflow_map(
    fn = "tune_sim_anneal", 
    resamples = folds,
    iter = 2,
    control = sim_ctrl, 
    initial = 1
  )
#> ℹ The workflow being saved contains a recipe, which is 9.66 Mb in ℹ memory. If
#> this was not intentional, please set the control setting ℹ `save_workflow =
#> FALSE`.
#> Optimizing rmse
#> Initial best: 7.30250
#> ℹ The workflow being saved contains a recipe, which is 9.66 Mb in ℹ memory. If
#> this was not intentional, please set the control setting ℹ `save_workflow =
#> FALSE`.
#> 1 ◯ accept suboptimal  rmse=7.3391 (+/-0.2557)
#> ℹ The workflow being saved contains a recipe, which is 9.66 Mb in ℹ memory. If
#> this was not intentional, please set the control setting ℹ `save_workflow =
#> FALSE`.
#> 2 ◯ accept suboptimal  rmse=7.392 (+/-0.2306)

Created on 2025-03-10 with reprex v2.1.1

Session info

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.2 (2024-10-31)
#>  os       macOS Sequoia 15.3.1
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       America/Los_Angeles
#>  date     2025-03-10
#>  pandoc   3.4 @ /usr/local/bin/ (via rmarkdown)
#>  quarto   1.5.57 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version    date (UTC) lib source
#>  bit            4.5.0.1    2024-12-03 [1] CRAN (R 4.4.1)
#>  bit64          4.6.0-1    2025-01-16 [1] CRAN (R 4.4.1)
#>  class          7.3-23     2025-01-01 [1] CRAN (R 4.4.1)
#>  cli            3.6.4      2025-02-13 [1] CRAN (R 4.4.1)
#>  codetools      0.2-20     2024-03-31 [1] CRAN (R 4.4.2)
#>  colorspace     2.1-1      2024-07-26 [1] CRAN (R 4.4.0)
#>  crayon         1.5.3      2024-06-20 [1] CRAN (R 4.4.0)
#>  curl           6.2.1      2025-02-19 [1] CRAN (R 4.4.1)
#>  data.table     1.17.0     2025-02-22 [1] CRAN (R 4.4.1)
#>  dials          1.4.0      2025-02-13 [1] CRAN (R 4.4.1)
#>  DiceDesign     1.10       2023-12-07 [1] CRAN (R 4.4.0)
#>  digest         0.6.37     2024-08-19 [1] CRAN (R 4.4.1)
#>  dplyr        * 1.1.4      2023-11-17 [1] CRAN (R 4.4.0)
#>  evaluate       1.0.3      2025-01-10 [1] CRAN (R 4.4.1)
#>  fastmap        1.2.0      2024-05-15 [1] CRAN (R 4.4.0)
#>  finetune     * 1.2.0      2024-03-21 [1] CRAN (R 4.4.0)
#>  foreach        1.5.2      2022-02-02 [1] CRAN (R 4.4.0)
#>  fs             1.6.5      2024-10-30 [1] CRAN (R 4.4.1)
#>  furrr          0.3.1      2022-08-15 [1] CRAN (R 4.4.0)
#>  future         1.34.0     2024-07-29 [1] CRAN (R 4.4.0)
#>  future.apply   1.11.3     2024-10-27 [1] CRAN (R 4.4.1)
#>  generics       0.1.3      2022-07-05 [1] CRAN (R 4.4.0)
#>  ggplot2        3.5.1.9000 2024-12-02 [1] Github (tidyverse/ggplot2@4af509e)
#>  globals        0.16.3     2024-03-08 [1] CRAN (R 4.4.0)
#>  glue           1.8.0      2024-09-30 [1] CRAN (R 4.4.1)
#>  gower          1.0.2      2024-12-17 [1] CRAN (R 4.4.1)
#>  GPfit          1.0-8      2019-02-08 [1] CRAN (R 4.4.0)
#>  gtable         0.3.6      2024-10-25 [1] CRAN (R 4.4.1)
#>  hardhat        1.4.1      2025-01-31 [1] CRAN (R 4.4.1)
#>  hms            1.1.3      2023-03-21 [1] CRAN (R 4.4.0)
#>  htmltools      0.5.8.1    2024-04-04 [1] CRAN (R 4.4.0)
#>  ipred          0.9-15     2024-07-18 [1] CRAN (R 4.4.0)
#>  iterators      1.0.14     2022-02-05 [1] CRAN (R 4.4.0)
#>  jsonlite       1.9.0      2025-02-19 [1] CRAN (R 4.4.1)
#>  knitr          1.49       2024-11-08 [1] CRAN (R 4.4.1)
#>  lattice        0.22-6     2024-03-20 [1] CRAN (R 4.4.2)
#>  lava           1.8.1      2025-01-12 [1] CRAN (R 4.4.1)
#>  lhs            1.2.0      2024-06-30 [1] CRAN (R 4.4.0)
#>  lifecycle      1.0.4      2023-11-07 [1] CRAN (R 4.4.0)
#>  listenv        0.9.1      2024-01-29 [1] CRAN (R 4.4.0)
#>  lubridate      1.9.4      2024-12-08 [1] CRAN (R 4.4.1)
#>  magrittr       2.0.3      2022-03-30 [1] CRAN (R 4.4.0)
#>  MASS           7.3-64     2025-01-04 [1] CRAN (R 4.4.1)
#>  Matrix         1.7-2      2025-01-23 [1] CRAN (R 4.4.1)
#>  munsell        0.5.1      2024-04-01 [1] CRAN (R 4.4.0)
#>  nnet           7.3-20     2025-01-01 [1] CRAN (R 4.4.1)
#>  parallelly     1.42.0     2025-01-30 [1] CRAN (R 4.4.1)
#>  parsnip      * 1.3.0      2025-02-14 [1] CRAN (R 4.4.1)
#>  pillar         1.10.1     2025-01-07 [1] CRAN (R 4.4.1)
#>  pkgconfig      2.0.3      2019-09-22 [1] CRAN (R 4.4.0)
#>  prodlim        2024.06.25 2024-06-24 [1] CRAN (R 4.4.0)
#>  purrr          1.0.4      2025-02-05 [1] CRAN (R 4.4.1)
#>  R6             2.6.1      2025-02-15 [1] CRAN (R 4.4.1)
#>  Rcpp           1.0.14     2025-01-12 [1] CRAN (R 4.4.1)
#>  readr        * 2.1.5      2024-01-10 [1] CRAN (R 4.4.0)
#>  recipes      * 1.1.1      2025-02-12 [1] CRAN (R 4.4.1)
#>  reprex       * 2.1.1      2024-07-06 [1] CRAN (R 4.4.0)
#>  rlang          1.1.5      2025-01-17 [1] CRAN (R 4.4.2)
#>  rmarkdown      2.29       2024-11-04 [1] CRAN (R 4.4.1)
#>  rpart          4.1.24     2025-01-07 [1] CRAN (R 4.4.1)
#>  rsample      * 1.2.1      2024-03-25 [1] CRAN (R 4.4.0)
#>  rstudioapi     0.17.1     2024-10-22 [1] CRAN (R 4.4.1)
#>  scales         1.3.0      2023-11-28 [1] CRAN (R 4.4.0)
#>  sessioninfo    1.2.3      2025-02-05 [1] CRAN (R 4.4.1)
#>  sparsevctrs    0.2.0      2025-01-22 [1] CRAN (R 4.4.1)
#>  survival       3.8-3      2024-12-17 [1] CRAN (R 4.4.1)
#>  tibble         3.2.1      2023-03-20 [1] CRAN (R 4.4.0)
#>  tidyr          1.3.1      2024-01-24 [1] CRAN (R 4.4.0)
#>  tidyselect     1.2.1      2024-03-11 [1] CRAN (R 4.4.0)
#>  timechange     0.3.0      2024-01-18 [1] CRAN (R 4.4.0)
#>  timeDate       4041.110   2024-09-22 [1] CRAN (R 4.4.1)
#>  tune         * 1.3.0      2025-02-21 [1] CRAN (R 4.4.1)
#>  tzdb           0.4.0      2023-05-12 [1] CRAN (R 4.4.0)
#>  vctrs          0.6.5      2023-12-01 [1] CRAN (R 4.4.0)
#>  vroom          1.6.5      2023-12-05 [1] CRAN (R 4.4.0)
#>  withr          3.0.2      2024-10-28 [1] CRAN (R 4.4.1)
#>  workflows      1.2.0      2025-02-19 [1] CRAN (R 4.4.1)
#>  workflowsets * 1.1.0      2024-03-21 [1] CRAN (R 4.4.0)
#>  xfun           0.51       2025-02-19 [1] CRAN (R 4.4.1)
#>  xgboost      * 1.7.8.1    2024-07-24 [1] CRAN (R 4.4.0)
#>  yaml           2.3.10     2024-07-26 [1] CRAN (R 4.4.0)
#>  yardstick      1.3.2      2025-01-22 [1] CRAN (R 4.4.2)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#>  * ── Packages attached to the search path.
#> 
#> ──────────────────────────────────────────────────────────────────────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant