Skip to content

Commit

Permalink
improved docs for as.data.table(mlr_pipeops)
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser committed Feb 14, 2025
1 parent e937803 commit 5156c9e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
4 changes: 2 additions & 2 deletions R/PipeOp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)`.
Expand Down
25 changes: 22 additions & 3 deletions R/mlr_pipeops.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions man/PipeOp.Rd

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

27 changes: 24 additions & 3 deletions man/mlr_pipeops.Rd

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

0 comments on commit 5156c9e

Please sign in to comment.