Skip to content

Conversation

EmilHvitfeldt
Copy link
Member

Follow up on tidymodels/tune#1071.

If there isn't any tuning parameters set in a workflow, we can early exit, which for the following example leads to an almost 20% speed increase

After

library(tidymodels)
ames <- ames |>
  select(where(is.numeric))

svm_spec <- null_model(mode = "regression")

set.seed(1)
cv1 <- rsample::bootstraps(ames)

set.seed(1)

bench::mark(
  run = fit_resamples(
    svm_spec,
    Sale_Price ~ .,
    cv1, metrics = metric_set(yardstick::rmse),
    control = control_grid(save_pred = TRUE)
  ), iterations = 10
)
#> Warning: Some expressions had a GC in every iteration; so filtering is
#> disabled.
#> # A tibble: 1 × 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 run           378ms    388ms      2.41     162MB     10.4

Created on 2025-08-01 with reprex v2.1.1

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

Successfully merging this pull request may close these issues.

1 participant