Skip to content

Commit c711cf4

Browse files
authored
Merge pull request #873 from mlr-org/docs_various
2 parents d741099 + c5a51cc commit c711cf4

File tree

159 files changed

+1030
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+1030
-689
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
* Fix: Corrected hash calculation for `PipeOpFilter`.
1313
* New PipeOps `PipeOpEncodePLQuantiles` and `PipeOpEncodePLTree` that implement piecewise linear encoding with two different binning methods.
1414
* Compatibility with new `R6` release.
15+
* Docs: Performed cleanup and standardization.
16+
* Docs: Performed cleanup of reference index page on website.
17+
* Docs: Fixed parsing of examples on website for `PipeOpNMF` and `PipeOpLearnerPICVPlus`.
1518
* Fix: `PipeOpTargetMutate` and `PipeOpTargetTrafoScaleRange` no longer drop unseen factor levels of features or targets during train and predict.
1619
* Simplified parameter checks and added internal type checking for `PipeOpTargetMutate`.
1720

R/Graph.R

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#' @format [`R6Class`][R6::R6Class].
55
#'
66
#' @description
7-
#' A [`Graph`] is a representation of a machine learning pipeline graph. It can be *trained*, and subsequently used for *prediction*.
7+
#' A `Graph` is a representation of a machine learning pipeline graph. It can be *trained*, and subsequently used for *prediction*.
88
#'
9-
#' A [`Graph`] is most useful when used together with [`Learner`][mlr3::Learner] objects encapsulated as [`PipeOpLearner`]. In this case,
10-
#' the [`Graph`] produces [`Prediction`][mlr3::Prediction] data during its `$predict()` phase and can be used as a [`Learner`][mlr3::Learner]
11-
#' itself (using the [`GraphLearner`] wrapper). However, the [`Graph`] can also be used without [`Learner`][mlr3::Learner] objects to simply
9+
#' A `Graph` is most useful when used together with [`Learner`][mlr3::Learner] objects encapsulated as [`PipeOpLearner`]. In this case,
10+
#' the `Graph` produces [`Prediction`][mlr3::Prediction] data during its `$predict()` phase and can be used as a [`Learner`][mlr3::Learner]
11+
#' itself (using the [`GraphLearner`] wrapper). However, the `Graph` can also be used without [`Learner`][mlr3::Learner] objects to simply
1212
#' perform preprocessing of data, and, in principle, does not even need to handle data at all but can be used for general processes with
1313
#' dependency structure (although the [`PipeOp`]s for this would need to be written).
1414
#'
@@ -18,45 +18,45 @@
1818
#' ```
1919
#'
2020
#' @section Internals:
21-
#' A [`Graph`] is made up of a list of [`PipeOp`]s, and a [`data.table`][data.table::data.table] of edges. Both for training and prediction, the [`Graph`]
21+
#' A `Graph` is made up of a list of [`PipeOp`]s, and a [`data.table`][data.table::data.table] of edges. Both for training and prediction, the `Graph`
2222
#' performs topological sorting of the [`PipeOp`]s and executes their respective `$train()` or `$predict()` functions in order, moving
2323
#' the [`PipeOp`] results along the edges as input to other [`PipeOp`]s.
2424
#'
2525
#' @section Fields:
2626
#' * `pipeops` :: named `list` of [`PipeOp`] \cr
27-
#' Contains all [`PipeOp`]s in the [`Graph`], named by the [`PipeOp`]'s `$id`s.
27+
#' Contains all [`PipeOp`]s in the `Graph`, named by the [`PipeOp`]'s `$id`s.
2828
#' * `edges` :: [`data.table`][data.table::data.table] with columns `src_id` (`character`), `src_channel` (`character`), `dst_id` (`character`), `dst_channel` (`character`)\cr
2929
#' Table of connections between the [`PipeOp`]s. A [`data.table`][data.table::data.table]. `src_id` and `dst_id` are `$id`s of [`PipeOp`]s that must be present in
3030
#' the `$pipeops` list. `src_channel` and `dst_channel` must respectively be `$output` and `$input` channel names of the
3131
#' respective [`PipeOp`]s.
3232
#' * `is_trained` :: `logical(1)` \cr
33-
#' Is the [`Graph`], i.e. are all of its [`PipeOp`]s, trained, and can the [`Graph`] be used for prediction?
33+
#' Is the `Graph`, i.e. are all of its [`PipeOp`]s, trained, and can the `Graph` be used for prediction?
3434
#' * `lhs` :: `character` \cr
35-
#' Ids of the 'left-hand-side' [`PipeOp`]s that have some unconnected input channels and therefore act as [`Graph`] input layer.
35+
#' Ids of the 'left-hand-side' [`PipeOp`]s that have some unconnected input channels and therefore act as `Graph` input layer.
3636
#' * `rhs` :: `character` \cr
37-
#' Ids of the 'right-hand-side' [`PipeOp`]s that have some unconnected output channels and therefore act as [`Graph`] output layer.
37+
#' Ids of the 'right-hand-side' [`PipeOp`]s that have some unconnected output channels and therefore act as `Graph` output layer.
3838
#' * `input` :: [`data.table`][data.table::data.table] with columns `name` (`character`), `train` (`character`), `predict` (`character`), `op.id` (`character`), `channel.name` (`character`)\cr
39-
#' Input channels of the [`Graph`]. For each channel lists the name, input type during training, input type during prediction,
39+
#' Input channels of the `Graph`. For each channel lists the name, input type during training, input type during prediction,
4040
#' [`PipeOp`] `$id` of the [`PipeOp`] the channel pertains to, and channel name as the [`PipeOp`] knows it.
4141
#' * `output` :: [`data.table`][data.table::data.table] with columns `name` (`character`), `train` (`character`), `predict` (`character`), `op.id` (`character`), `channel.name` (`character`)\cr
42-
#' Output channels of the [`Graph`]. For each channel lists the name, output type during training, output type during prediction,
42+
#' Output channels of the `Graph`. For each channel lists the name, output type during training, output type during prediction,
4343
#' [`PipeOp`] `$id` of the [`PipeOp`] the channel pertains to, and channel name as the [`PipeOp`] knows it.
4444
#' * `packages` :: `character`\cr
45-
#' Set of all required packages for the various methods in the [`Graph`], a set union of all required packages of all contained
45+
#' Set of all required packages for the various methods in the `Graph`, a set union of all required packages of all contained
4646
#' [`PipeOp`] objects.
4747
#' * `state` :: named `list`\cr
4848
#' Get / Set the `$state` of each of the members of [`PipeOp`].
4949
#' * `param_set` :: [`ParamSet`][paradox::ParamSet]\cr
5050
#' Parameters and parameter constraints. Parameter values are in `$param_set$values`. These are the union of `$param_set`s
51-
#' of all [`PipeOp`]s in the [`Graph`]. Parameter names
52-
#' as seen by the [`Graph`] have the naming scheme `<PipeOp$id>.<PipeOp original parameter name>`.
51+
#' of all [`PipeOp`]s in the `Graph`. Parameter names
52+
#' as seen by the `Graph` have the naming scheme `<PipeOp$id>.<PipeOp original parameter name>`.
5353
#' Changing `$param_set$values` also propagates the changes directly to the contained
5454
#' [`PipeOp`]s and is an alternative to changing a [`PipeOp`]s `$param_set$values` directly.
5555
#' * `hash` :: `character(1)` \cr
56-
#' Stores a checksum calculated on the [`Graph`] configuration, which includes all [`PipeOp`] hashes
56+
#' Stores a checksum calculated on the `Graph` configuration, which includes all [`PipeOp`] hashes
5757
#' (and therefore their `$param_set$values`) and a hash of `$edges`.
5858
#' * `phash` :: `character(1)` \cr
59-
#' Stores a checksum calculated on the [`Graph`] configuration, which includes all [`PipeOp`] hashes
59+
#' Stores a checksum calculated on the `Graph` configuration, which includes all [`PipeOp`] hashes
6060
#' *except* their `$param_set$values`, and a hash of `$edges`.
6161
#' * `keep_results` :: `logical(1)`\cr
6262
#' Whether to store intermediate results in the [`PipeOp`]'s `$.result` slot, mostly for debugging purposes. Default `FALSE`.
@@ -70,8 +70,8 @@
7070
#' `sorted` is `FALSE`, and topologically sorted if `sorted` is `TRUE`.
7171
#' * `add_pipeop(op, clone = TRUE)` \cr
7272
#' ([`PipeOp`] | [`Learner`][mlr3::Learner] | [`Filter`][mlr3filters::Filter] | `...`, `logical(1)`) -> `self` \cr
73-
#' Mutates [`Graph`] by adding a [`PipeOp`] to the [`Graph`]. This does not add any edges, so the new [`PipeOp`]
74-
#' will not be connected within the [`Graph`] at first.\cr
73+
#' Mutates `Graph` by adding a [`PipeOp`] to the `Graph`. This does not add any edges, so the new [`PipeOp`]
74+
#' will not be connected within the `Graph` at first.\cr
7575
#' Instead of supplying a [`PipeOp`] directly, an object that can naturally be converted to a [`PipeOp`] can also
7676
#' be supplied, e.g. a [`Learner`][mlr3::Learner] or a [`Filter`][mlr3filters::Filter]; see [`as_pipeop()`].
7777
#' The argument given as `op` is cloned if `clone` is `TRUE` (default); to access a `Graph`'s [`PipeOp`]s
@@ -93,16 +93,16 @@
9393
#' connecting them using [`%>>%`].
9494
#' * `plot(html = FALSE, horizontal = FALSE)` \cr
9595
#' (`logical(1)`, `logical(1)`) -> `NULL` \cr
96-
#' Plot the [`Graph`], using either the \pkg{igraph} package (for `html = FALSE`, default) or
96+
#' Plot the `Graph`, using either the \pkg{igraph} package (for `html = FALSE`, default) or
9797
#' the `visNetwork` package for `html = TRUE` producing a [`htmlWidget`][htmlwidgets::htmlwidgets].
9898
#' The [`htmlWidget`][htmlwidgets::htmlwidgets] can be rescaled using [`visOptions`][visNetwork::visOptions].
9999
#' For `html = FALSE`, the orientation of the plotted graph can be controlled through `horizontal`.
100100
#' * `print(dot = FALSE, dotname = "dot", fontsize = 24L)` \cr
101101
#' (`logical(1)`, `character(1)`, `integer(1)`) -> `NULL` \cr
102-
#' Print a representation of the [`Graph`] on the console. If `dot` is `FALSE`, output is a table with one row for each contained [`PipeOp`] and
102+
#' Print a representation of the `Graph` on the console. If `dot` is `FALSE`, output is a table with one row for each contained [`PipeOp`] and
103103
#' columns `ID` (`$id` of `PipeOp`), `State` (short representation of `$state` of [`PipeOp`]), `sccssors` ([`PipeOp`]s that
104104
#' take their input directly from the [`PipeOp`] on this line), and `prdcssors` (the [`PipeOp`]s that produce the data
105-
#' that is read as input by the [`PipeOp`] on this line). If `dot` is `TRUE`, print a DOT representation of the [`Graph`] on the console.
105+
#' that is read as input by the [`PipeOp`] on this line). If `dot` is `TRUE`, print a DOT representation of the `Graph` on the console.
106106
#' The DOT output can be named via the argument `dotname` and the `fontsize` can also be specified.
107107
#' * `set_names(old, new)` \cr
108108
#' (`character`, `character`) -> `self` \cr
@@ -113,21 +113,21 @@
113113
#' Pre- or postfix [`PipeOp`]'s existing ids. Both `prefix` and `postfix` default to `""`, i.e. no changes.
114114
#' * `train(input, single_input = TRUE)` \cr
115115
#' (`any`, `logical(1)`) -> named `list`\cr
116-
#' Train [`Graph`] by traversing the [`Graph`]s' edges and calling all the [`PipeOp`]'s `$train` methods in turn.
116+
#' Train `Graph` by traversing the `Graph`s' edges and calling all the [`PipeOp`]'s `$train` methods in turn.
117117
#' Return a named `list` of outputs for each unconnected
118-
#' [`PipeOp`] out-channel, named according to the [`Graph`]'s `$output` `name` column. During training, the `$state`
118+
#' [`PipeOp`] out-channel, named according to the `Graph`'s `$output` `name` column. During training, the `$state`
119119
#' member of each [`PipeOp`]s will be set and the `$is_trained` slot of the `Graph` (and each individual `PipeOp`) will
120120
#' consequently be set to `TRUE`.\cr
121121
#' If `single_input` is `TRUE`, the `input` value will be sent to each unconnected [`PipeOp`]'s input channel
122-
#' (as listed in the [`Graph`]'s `$input`). Typically, `input` should be a [`Task`][mlr3::Task], although this is dependent
123-
#' on the [`PipeOp`]s in the [`Graph`]. If `single_input` is `FALSE`, then
124-
#' `input` should be a `list` with the same length as the [`Graph`]'s `$input` table has rows; each list item will be sent
125-
#' to a corresponding input channel of the [`Graph`]. If `input` is a named `list`, names must correspond to input channel
122+
#' (as listed in the `Graph`'s `$input`). Typically, `input` should be a [`Task`][mlr3::Task], although this is dependent
123+
#' on the [`PipeOp`]s in the `Graph`. If `single_input` is `FALSE`, then
124+
#' `input` should be a `list` with the same length as the `Graph`'s `$input` table has rows; each list item will be sent
125+
#' to a corresponding input channel of the `Graph`. If `input` is a named `list`, names must correspond to input channel
126126
#' names (`$input$name`) and inputs will be sent to the channels by name; otherwise they will be sent to the channels
127127
#' in order in which they are listed in `$input`.
128128
#' * `predict(input, single_input = TRUE)` \cr
129129
#' (`any`, `logical(1)`) -> `list` of `any` \cr
130-
#' Predict with the [`Graph`] by calling all the [`PipeOp`]'s `$train` methods. Input and output, as well as the function
130+
#' Predict with the `Graph` by calling all the [`PipeOp`]'s `$train` methods. Input and output, as well as the function
131131
#' of the `single_input` argument, are analogous to `$train()`.
132132
#' * `help(help_type)` \cr
133133
#' (`character(1)`) -> help file\cr

0 commit comments

Comments
 (0)