Skip to content

Commit b19f0e7

Browse files
Merge pull request #618 from tidymodels/deprecate-fit_control
2 parents c81f942 + 62914b0 commit b19f0e7

File tree

6 files changed

+74
-16
lines changed

6 files changed

+74
-16
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818

1919
* The fit time is only calculated when the `verbosity` argument of `control_parsnip()` is 2L or greater. Also, the call to `system.time()` now uses `gcFirst = FALSE`. (#611)
2020

21+
* `fit_control()` is soft-deprecated in favor of `control_parsnip()`.
22+
2123
* Argument `interval` was added for prediction: For types "survival" and "quantile", estimates for the confidence or prediction interval can be added if available (#615).
2224

25+
2326
# parsnip 0.1.7
2427

2528
## Model Specification Changes

R/control_parsnip.R

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,14 @@
1818
#' @examples
1919
#' control_parsnip(verbosity = 2L)
2020
#'
21-
#' @details
22-
#' `fit_control()` is deprecated in favor of `control_parsnip()`.
2321
#' @export
24-
#'
2522
control_parsnip <- function(verbosity = 1L, catch = FALSE) {
2623
res <- list(verbosity = verbosity, catch = catch)
2724
res <- check_control(res)
2825
class(res) <- "control_parsnip"
2926
res
3027
}
3128

32-
#' @export
33-
#' @rdname control_parsnip
34-
fit_control <- function(verbosity = 1L, catch = FALSE) {
35-
control_parsnip(verbosity = verbosity, catch = catch)
36-
}
37-
3829
#' @export
3930
print.control_parsnip <- function(x, ...) {
4031
cat("parsnip control object\n")

R/fit_control.R

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#' Control the fit function
2+
#'
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' Pass options to the [fit.model_spec()] function to control its
7+
#' output and computations
8+
#'
9+
#' @param verbosity An integer to control how verbose the output is. For a
10+
#' value of zero, no messages or output are shown when packages are loaded or
11+
#' when the model is fit. For a value of 1, package loading is quiet but model
12+
#' fits can produce output to the screen (depending on if they contain their
13+
#' own `verbose`-type argument). For a value of 2 or more, any output at all
14+
#' is displayed and the execution time of the fit is recorded and printed.
15+
#' @param catch A logical where a value of `TRUE` will evaluate the model
16+
#' inside of `try(, silent = TRUE)`. If the model fails, an object is still
17+
#' returned (without an error) that inherits the class "try-error".
18+
#' @return An S3 object with class "control_parsnip" that is a named list
19+
#' with the results of the function call
20+
#'
21+
#' @examples
22+
#' fit_control(verbosity = 2L)
23+
#'
24+
#' @details
25+
#' `fit_control()` is deprecated in favor of `control_parsnip()`.
26+
#'
27+
#' @export
28+
#' @keywords internal
29+
fit_control <- function(verbosity = 1L, catch = FALSE) {
30+
lifecycle::deprecate_soft("0.1.8", "fit_control()", "control_parsnip()")
31+
control_parsnip(verbosity = verbosity, catch = catch)
32+
}

_pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ reference:
5454
- extract-parsnip
5555
- fit.model_spec
5656
- fit_xy
57-
- fit_control
57+
- control_parsnip
5858
- glance.model_fit
5959
- model_fit
6060
- model_spec

man/control_parsnip.Rd

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fit_control.Rd

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)