Skip to content

Commit bea8235

Browse files
authored
caution against estimation in custom transformations (#64)
1 parent f5db29b commit bea8235

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Diff for: R/adjust-predictions-custom.R

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
#' the commands.
99
#' @param ... Name-value pairs of expressions. See [dplyr::mutate()].
1010
#'
11+
#' @section Data-dependent transformations:
12+
#' Note that custom adjustments should not carry out estimation. If they do,
13+
#' the estimation steps will be carried out independently at `fit()`
14+
#' and `predict()` time. For example, if your transformation includes a mean
15+
#' shift, the postprocessor will take the mean of the column supplied in the
16+
#' training data at `fit()` and, rather than reusing that mean at `predict()`
17+
#' will take the mean again of the dataset supplied at `predict()` time.
18+
#'
1119
#' @inheritSection adjust_equivocal_zone Data Usage
1220
#'
1321
#' @examplesIf rlang::is_installed(c("probably", "modeldata"))
@@ -42,8 +50,6 @@ adjust_predictions_custom <- function(x, ..., .pkgs = character(0)) {
4250
arguments = list(commands = cmds, pkgs = .pkgs),
4351
results = list(),
4452
trained = FALSE,
45-
# todo: should there be a user interface to tell tailor whether this
46-
# adjustment requires fit?
4753
requires_fit = FALSE
4854
)
4955

Diff for: man/adjust_predictions_custom.Rd

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)