diff --git a/R/PipeOp.R b/R/PipeOp.R index ad45a06f2..c31e9677f 100644 --- a/R/PipeOp.R +++ b/R/PipeOp.R @@ -97,7 +97,7 @@ #' training, column `predict` is the (S3) class that an input object must conform to during prediction. Types #' are checked by the [`PipeOp`] itself and do not need to be checked by `private$.train()` / `private$.predict()` code.\cr #' A special name is `"..."`, which creates a *vararg* input channel that accepts a variable number of inputs.\cr -#' If a row has both `train` and `predict` values enclosed by square brackets ("`[`", "`]`), then this channel is +#' If a row has both `train` and `predict` values enclosed by square brackets ("`[`", "`]`"), then this channel is #' [`Multiplicity`]-aware. If the [`PipeOp`] receives a [`Multiplicity`] value on these channels, this [`Multiplicity`] #' is given to the `.train()` and `.predict()` functions directly. Otherwise, the [`Multiplicity`] is transparently #' unpacked and the `.train()` and `.predict()` functions are called multiple times, once for each [`Multiplicity`] element. @@ -108,7 +108,7 @@ #' `$predict` functions. Column `train` is the (S3) class that an output object must conform to during training, #' column `predict` is the (S3) class that an output object must conform to during prediction. The [`PipeOp`] checks #' values returned by `private$.train()` and `private$.predict()` against these types specifications.\cr -#' If a row has both `train` and `predict` values enclosed by square brackets ("`[`", "`]`), then this signals that the channel +#' If a row has both `train` and `predict` values enclosed by square brackets ("`[`", "`]`"), then this signals that the channel #' emits a [`Multiplicity`] of the indicated type. See [`Multiplicity`] for more information. #' * `innum` :: `numeric(1)` \cr #' Number of input channels. This equals `nrow($input)`. diff --git a/R/mlr_pipeops.R b/R/mlr_pipeops.R index d3a104e0a..de5aa4bfa 100644 --- a/R/mlr_pipeops.R +++ b/R/mlr_pipeops.R @@ -25,9 +25,28 @@ #' @section S3 methods: #' * `as.data.table(dict)`\cr #' [`Dictionary`][mlr3misc::Dictionary] -> [`data.table::data.table`]\cr -#' Returns a `data.table` with columns `key` (`character`), `packages` (`character`), -#' `input.num` (`integer`), `output.num` (`integer`), `input.type.train` (`character`), -#' `input.type.predict` (`character`), `output.type.train` (`character`), `output.type.predict` (`character`). +#' Returns a `data.table` with the following columns: +#' * `key` :: (`character`)\cr +#' Key with which the [`PipeOp`] was registered to the [`Dictionary`][mlr3misc::Dictionary] using the `$add()` method. +#' * `label` :: (`character`)\cr +#' Description of the [`PipeOp`]'s functionality. +#' * `packages` :: (`character`)\cr +#' Set of all required packages for the ['PipeOp']'s train and ⁠predict⁠ methods. +#' * `tags` :: (`character`)\cr +#' A set of tags associated with the [`PipeOp`] describing its purpose. +#' * `feature_types` :: (`character`)\cr +#' Feature types the [`PipeOp`] operates on. Is `NA` for [`PipeOp`]s that do not directly operate on a [Task][mlr3::Task]. +#' * `input.num`, `output.num` :: (`integer`)\cr +#' Number of the [`PipeOp`]'s input and output channels. Is `NA` for [`PipeOp`]s which accept a varying number of input +#' and/or output channels depending a construction argument. +#' See `input` and `output` fields of [`PipeOp`]. +#' * `input.type.train`, `input.type.predict`, `output.type.train`, `output.type.predict` :: (`character`)\cr +#' Types that are allowed as input to or returned as output of the [`PipeOp`]'s `$train()` and `$predict()` methods.\cr +#' A value of `NULL` means that a null object, e.g. no data, is taken as input or being returned as output. +#' A value of "`*`" means that any type is possible.\cr +#' If both `input.type.train` and `output.type.train` or both `input.type.predict` and `output.type.predict` contain +#' values enclosed by square brackets ("`[`", "`]`"), then the respective input or channel is +#' [`Multiplicity`]-aware. For more information, see [`Multiplicity`]. #' #' @family mlr3pipelines backend related #' @family PipeOps diff --git a/man/PipeOp.Rd b/man/PipeOp.Rd index 375f41497..a7d5f2fa1 100644 --- a/man/PipeOp.Rd +++ b/man/PipeOp.Rd @@ -104,7 +104,7 @@ Input channels of \code{\link{PipeOp}}. Column \code{name} gives the names (and training, column \code{predict} is the (S3) class that an input object must conform to during prediction. Types are checked by the \code{\link{PipeOp}} itself and do not need to be checked by \code{private$.train()} / \code{private$.predict()} code.\cr A special name is \code{"..."}, which creates a \emph{vararg} input channel that accepts a variable number of inputs.\cr -If a row has both \code{train} and \code{predict} values enclosed by square brackets ("\code{[}", "\verb{]}), then this channel is +If a row has both \code{train} and \code{predict} values enclosed by square brackets ("\code{[}", "\verb{]}"), then this channel is \code{\link{Multiplicity}}-aware. If the \code{\link{PipeOp}} receives a \code{\link{Multiplicity}} value on these channels, this \code{\link{Multiplicity}} is given to the \code{.train()} and \code{.predict()} functions directly. Otherwise, the \code{\link{Multiplicity}} is transparently unpacked and the \code{.train()} and \code{.predict()} functions are called multiple times, once for each \code{\link{Multiplicity}} element. @@ -115,7 +115,7 @@ Output channels of \code{\link{PipeOp}}, in the order in which they will be give \verb{$predict} functions. Column \code{train} is the (S3) class that an output object must conform to during training, column \code{predict} is the (S3) class that an output object must conform to during prediction. The \code{\link{PipeOp}} checks values returned by \code{private$.train()} and \code{private$.predict()} against these types specifications.\cr -If a row has both \code{train} and \code{predict} values enclosed by square brackets ("\code{[}", "\verb{]}), then this signals that the channel +If a row has both \code{train} and \code{predict} values enclosed by square brackets ("\code{[}", "\verb{]}"), then this signals that the channel emits a \code{\link{Multiplicity}} of the indicated type. See \code{\link{Multiplicity}} for more information. \item \code{innum} :: \code{numeric(1)} \cr Number of input channels. This equals \verb{nrow($input)}. diff --git a/man/mlr_pipeops.Rd b/man/mlr_pipeops.Rd index e3128fd99..9436afab6 100644 --- a/man/mlr_pipeops.Rd +++ b/man/mlr_pipeops.Rd @@ -39,9 +39,30 @@ when it needs to be constructed for \code{as.data.table} \code{\link{PipeOp}} li \itemize{ \item \code{as.data.table(dict)}\cr \code{\link[mlr3misc:Dictionary]{Dictionary}} -> \code{\link[data.table:data.table]{data.table::data.table}}\cr -Returns a \code{data.table} with columns \code{key} (\code{character}), \code{packages} (\code{character}), -\code{input.num} (\code{integer}), \code{output.num} (\code{integer}), \code{input.type.train} (\code{character}), -\code{input.type.predict} (\code{character}), \code{output.type.train} (\code{character}), \code{output.type.predict} (\code{character}). +Returns a \code{data.table} with the following columns: +\itemize{ +\item \code{key} :: (\code{character})\cr +Key with which the \code{\link{PipeOp}} was registered to the \code{\link[mlr3misc:Dictionary]{Dictionary}} using the \verb{$add()} method. +\item \code{label} :: (\code{character})\cr +Description of the \code{\link{PipeOp}}'s functionality. +\item \code{packages} :: (\code{character})\cr +Set of all required packages for the \link{'PipeOp'}'s train and ⁠predict⁠ methods. +\item \code{tags} :: (\code{character})\cr +A set of tags associated with the \code{\link{PipeOp}} describing its purpose. +\item \code{feature_types} :: (\code{character})\cr +Feature types the \code{\link{PipeOp}} operates on. Is \code{NA} for \code{\link{PipeOp}}s that do not directly operate on a \link[mlr3:Task]{Task}. +\item \code{input.num}, \code{output.num} :: (\code{integer})\cr +Number of the \code{\link{PipeOp}}'s input and output channels. Is \code{NA} for \code{\link{PipeOp}}s which accept a varying number of input +and/or output channels depending a construction argument. +See \code{input} and \code{output} fields of \code{\link{PipeOp}}. +\item \code{input.type.train}, \code{input.type.predict}, \code{output.type.train}, \code{output.type.predict} :: (\code{character})\cr +Types that are allowed as input to or returned as output of the \code{\link{PipeOp}}'s \verb{$train()} and \verb{$predict()} methods.\cr +A value of \code{NULL} means that a null object, e.g. no data, is taken as input or being returned as output. +A value of "\code{*}" means that any type is possible.\cr +If both \code{input.type.train} and \code{output.type.train} or both \code{input.type.predict} and \code{output.type.predict} contain +values enclosed by square brackets ("\code{[}", "\verb{]}"), then the respective input or channel is +\code{\link{Multiplicity}}-aware. For more information, see \code{\link{Multiplicity}}. +} } }