Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Authors@R: c(
Description: The ability to tune models is important. 'tune' contains
functions and classes to be used in conjunction with other
'tidymodels' packages for finding reasonable values of
hyper-parameters in models, preprocessing methods, and
post-processing steps.
hyper-parameters in models, preprocessing methods, and post-processing
steps.
License: MIT + file LICENSE
URL: https://tune.tidymodels.org/, https://github.com/tidymodels/tune
BugReports: https://github.com/tidymodels/tune/issues
Expand All @@ -21,11 +21,12 @@ Imports:
cli (>= 3.3.0),
dials (>= 1.3.0.9000),
dplyr (>= 1.1.0),
GauPro (>= 0.2.15),
generics (>= 0.1.2),
ggplot2,
glue (>= 1.6.2),
GauPro (>= 0.2.15),
hardhat (>= 1.4.2),
lifecycle,
parallel,
parsnip (>= 1.4.1.9002),
purrr (>= 1.0.0),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tune (development version)

* `finalize_workflow_preprocessor()` is deprecated (#1157).

* Model tuning has been enabled for quantile regression models. (#1125)

* In `tune_grid()`, a bug was fixed that caused inefficiency where preprocessing steps were applied to data being predicted several times (redundantly). We now execute that operation once. (#1101)
Expand Down
6 changes: 6 additions & 0 deletions R/grid_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ has_metrics_by <- function(metrics_by) {

#' @export
#' @rdname tune-internal-functions
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `finalize_workflow_preprocessor()` is deprecated.
finalize_workflow_preprocessor <- function(workflow, grid_preprocessor) {
lifecycle::deprecate_warn("2.1.0", "finalize_workflow_preprocessor()")

# Already finalized, nothing to tune
if (ncol(grid_preprocessor) == 0L) {
return(workflow)
Expand Down
4 changes: 4 additions & 0 deletions man/tune-internal-functions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/testthat/_snaps/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@
9 <split [29/3]> Fold09 <tibble [6 x 5]> <tibble [0 x 4]>
10 <split [29/3]> Fold10 <tibble [6 x 5]> <tibble [0 x 4]>

# finalize_workflow_preprocessor() is deprecated

Code
wflow <- finalize_workflow_preprocessor(wflow, grid)
Condition
Warning:
`finalize_workflow_preprocessor()` was deprecated in tune 2.1.0.

9 changes: 9 additions & 0 deletions tests/testthat/test-grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -787,3 +787,12 @@ test_that("retain extra attributes", {
expect_null(attr(res, "workflow"))
expect_true(inherits(attr(res2, "workflow"), "workflow"))
})

test_that("finalize_workflow_preprocessor() is deprecated", {
helper_objects <- helper_objects_tune()
wflow <- workflow() |>
add_recipe(helper_objects$rec_tune_1) |>
add_model(helper_objects$lm_mod)
grid <- tibble::tibble(num_comp = 1L)
expect_snapshot(wflow <- finalize_workflow_preprocessor(wflow, grid))
})
Loading