Skip to content

Commit

Permalink
caution against estimation in custom transformations (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Jan 13, 2025
1 parent f5db29b commit bea8235
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/adjust-predictions-custom.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#' the commands.
#' @param ... Name-value pairs of expressions. See [dplyr::mutate()].
#'
#' @section Data-dependent transformations:
#' Note that custom adjustments should not carry out estimation. If they do,
#' the estimation steps will be carried out independently at `fit()`
#' and `predict()` time. For example, if your transformation includes a mean
#' shift, the postprocessor will take the mean of the column supplied in the
#' training data at `fit()` and, rather than reusing that mean at `predict()`
#' will take the mean again of the dataset supplied at `predict()` time.
#'
#' @inheritSection adjust_equivocal_zone Data Usage
#'
#' @examplesIf rlang::is_installed(c("probably", "modeldata"))
Expand Down Expand Up @@ -42,8 +50,6 @@ adjust_predictions_custom <- function(x, ..., .pkgs = character(0)) {
arguments = list(commands = cmds, pkgs = .pkgs),
results = list(),
trained = FALSE,
# todo: should there be a user interface to tell tailor whether this
# adjustment requires fit?
requires_fit = FALSE
)

Expand Down
10 changes: 10 additions & 0 deletions man/adjust_predictions_custom.Rd

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

0 comments on commit bea8235

Please sign in to comment.