Skip to content

Commit 69f7494

Browse files
committed
some more doclinks
1 parent 09aa9a2 commit 69f7494

12 files changed

+77
-74
lines changed

R/PipeOpEOd.R

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#' @title Equalized Odds Debiasing
3939
#' @usage NULL
4040
#' @name mlr_pipeops_equalized_odds
41-
#' @format \link[R6:R6Class]{R6::R6Class} object inheriting from \link[mlr3pipelines:PipeOpTaskPreproc]{mlr3pipelines::PipeOpTaskPreproc}/\link[mlr3pipelines:PipeOp]{mlr3pipelines::PipeOp}.
41+
#' @format \link[R6:R6Class]{R6::R6Class} object inheriting from
42+
#' \link[mlr3pipelines:PipeOpTaskPreproc]{mlr3pipelines::PipeOpTaskPreproc}/
43+
#' \link[mlr3pipelines:PipeOp]{mlr3pipelines::PipeOp}.
4244
#'
4345
#' @description
4446
#' Fairness post-processing method to achieve equalized odds fairness.
@@ -57,26 +59,26 @@
5759
#' * `param_vals` (`list()`)
5860
#'
5961
#' @section Input and Output Channels:
60-
#' Input and output channels are inherited from [PipeOpTaskPreproc]. Instead of a [`Task`][mlr3::Task], a
61-
#' [TaskClassif][mlr3::TaskClassif] is used as input and output during training and prediction.
62+
#' Input and output channels are inherited from [mlr3pipelines::PipeOpTaskPreproc]. Instead of a [mlr3::Task], a
63+
#' [mlr3::TaskClassif] is used as input and output during training and prediction.
6264
#'
63-
#' The output during training is the input [Task][mlr3::Task]. The output during prediction is
64-
#' a [PredictionClassif][mlr3::PredictionClassif] with partially flipped predictions.
65+
#' The output during training is the input [mlr3::Task]. The output during prediction is
66+
#' a [mlr3::PredictionClassif] with partially flipped predictions.
6567
#'
6668
#' @section State:
67-
#' The `$state` is a named `list` with the `$state` elements inherited from [PipeOpTaskPreproc].
69+
#' The `$state` is a named list with the `$state` elements inherited from [mlr3pipelines::PipeOpTaskPreproc].
6870
#'
6971
#' @section Parameters:
70-
#' * `alpha` (`numeric()`): A number between 0 (no debiasing) and 1 (full debiasing).
72+
#' * `alpha` (numeric): A number between 0 (no debiasing) and 1 (full debiasing).
7173
#' Controls the debiasing strength by multiplying the flipping probabilities with alpha.
72-
#' * `privileged` (`character()`): The privileged group.
74+
#' * `privileged` (character): The privileged group.
7375
#'
7476
#'
7577
#' @section Fields:
76-
#' Only fields inherited from [PipeOpTaskPreproc]/[`PipeOp`].
78+
#' Only fields inherited from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
7779
#'
7880
#' @section Methods:
79-
#' Methods inherited from [PipeOpTaskPreproc]/[PipeOp].
81+
#' Methods inherited from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
8082
#'
8183
#' @family PipeOps
8284
#' @seealso https://mlr3book.mlr-org.com/list-pipeops.html
@@ -102,14 +104,14 @@
102104
#' # On newdata
103105
#' glrn$predict_newdata(task$data(cols = task$feature_names))
104106
PipeOpEOd = R6Class("PipeOpEOd",
105-
inherit = PipeOp,
107+
inherit = mlr3pipelines::PipeOp,
106108
public = list(
107109
#' @description
108-
#' Creates a new instance of this [R6][R6::R6Class][PipeOp] R6 class.
110+
#' Creates a new instance of this [R6::R6Class][mlr3pipelines::PipeOp] R6 class.
109111
#'
110-
#' @param id `character` \cr
112+
#' @param id character \cr
111113
#' The PipeOps identifier in the PipeOps library.
112-
#' @param param_vals `list` \cr
114+
#' @param param_vals list \cr
113115
#' The parameter values to be set. See `Parameters`.
114116
initialize = function(id = "EOd", param_vals = list()) {
115117
ps = ps(

R/PipeOpExplicitPta.R

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
#' * `param_vals` (`list()`)
1717
#'
1818
#' @section Input and Output Channels:
19-
#' Input and output channels are inherited from [PipeOpTaskPreproc]. Instead of a [Task][mlr3::Task], a
20-
#' [TaskClassif][mlr3::TaskClassif] is used as input and output during training and prediction.
19+
#' Input and output channels are inherited from [mlr3pipelines::PipeOpTaskPreproc]. Instead of a [mlr3::Task], a
20+
#' [mlr3::TaskClassif] is used as input and output during training and prediction.
2121
#'
22-
#' The output during training is the input [Task][mlr3::Task] with added weights column according
22+
#' The output during training is the input [mlr3::Task] with added weights column according
2323
#' to target class. The output during prediction is the unchanged input.
2424
#'
25-
#
2625
#' @section State:
27-
#' The `$state` is a named `list` with the `$state` elements inherited from [PipeOpTaskPreproc][mlr3pipelines::PipeOpTaskPreproc].
26+
#' The `$state` is a named `list` with the `$state` elements inherited from [mlr3pipelines::PipeOpTaskPreproc].
2827
#'
2928
#' @section Parameters:
3029
#' The PipeOp does not have any hyperparameters.
@@ -33,10 +32,10 @@
3332
#' Copies the existing pta column to a new column.
3433
#'
3534
#' @section Fields:
36-
#' Only fields inherited from [PipeOpTaskPreproc]/[`PipeOp`].
35+
#' Only fields inherited from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
3736
#'
3837
#' @section Methods:
39-
#' Methods inherited from [PipeOpTaskPreproc][mlr3pipelines::PipeOpTaskPreproc]/[PipeOp][mlr3pipelines::PipeOp].
38+
#' Methods inherited from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
4039
#'
4140
#' @family PipeOps
4241
#' @seealso https://mlr3book.mlr-org.com/list-pipeops.html
@@ -47,10 +46,10 @@
4746
#' epta = po("explicit_pta")
4847
#' new = epta$train(list(tsk("adult_train")))
4948
PipeOpExplicitPta = R6Class("PipeOpExplicitPta",
50-
inherit = PipeOpTaskPreproc,
49+
inherit = mlr3pipelines::PipeOpTaskPreproc,
5150
public = list(
5251
#' @description
53-
#' Creates a new instance of this [R6][R6::R6Class][PipeOp] R6 class.
52+
#' Creates a new instance of this [R6::R6Class][mlr3pipelines::PipeOpTaskPreproc] R6 class.
5453
#'
5554
#' @param id `character` \cr
5655
#' The PipeOps identifier in the PipeOps library.

R/PipeOpReweighing.R

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#' Adjusts class balance and protected group balance in order to achieve fair(er) outcomes.
99
#'
1010
#' @section PipeOpReweighingWeights:
11-
#' Adds a class weight column to the [Task][mlr3::Task] that different [`Learner`][mlr3::Learner]s
11+
#' Adds a class weight column to the [mlr3::Task] that different [mlr3::Learner]s
1212
#' may be using. In case initial weights are present, those are multiplied with new weights.
1313
#' Caution: Only fairness tasks are supported. Which means tasks need to have protected field.
1414
#' `tsk$col_roles$pta`.
1515
#'
1616
#' @section PipeOpReweighingOversampling:
17-
#' Oversamples a [Task][mlr3::Task] for more balanced ratios in subgroups and protected groups.
17+
#' Oversamples a [mlr3::Task] for more balanced ratios in subgroups and protected groups.
1818
#' Can be used if a learner does not support weights.
1919
#' Caution: Only fairness tasks are supported. Which means tasks need to have protected field.
2020
#' `tsk$col_roles$pta`.
@@ -30,31 +30,31 @@
3030
#' * `param_vals` (`list()`)
3131
#'
3232
#' @section Input and Output Channels:
33-
#' Input and output channels are inherited from [PipeOpTaskPreproc]. Instead of a [`Task`][mlr3::Task], a
34-
#' [TaskClassif][mlr3::TaskClassif] is used as input and output during training and prediction.
33+
#' Input and output channels are inherited from [mlr3pipelines::PipeOpTaskPreproc]. Instead of a [mlr3::Task], a
34+
#' [mlr3::TaskClassif] is used as input and output during training and prediction.
3535
#'
36-
#' The output during training is the input [Task][mlr3::Task] with added weights column according
36+
#' The output during training is the input [mlr3::Task] with added weights column according
3737
#' to target class. The output during prediction is the unchanged input.
3838
#'
3939
#' @section State:
40-
#' The `$state` is a named `list` with the `$state` elements inherited from [PipeOpTaskPreproc].
40+
#' The `$state` is a named `list` with the `$state` elements inherited from [mlr3pipelines::PipeOpTaskPreproc].
4141
#'
4242
#' @section Parameters:
4343
#' * `alpha` (`numeric()`): A number between 0 (no debiasing) and 1 (full debiasing).
4444
#'
4545
#' @section Internals:
46-
#' Introduces, or overwrites, the "weights" column in the [Task][mlr3::Task].
47-
#' However, the [Learner][mlr3::Learner] method needs to
46+
#' Introduces, or overwrites, the "weights" column in the [mlr3::Task].
47+
#' However, the [mlr3::Learner] method needs to
4848
#' respect weights for this to have an effect.
4949
#'
5050
#' The newly introduced column is named `reweighing.WEIGHTS`; there will be a naming conflict if this
5151
#' column already exists and is *not* a weight column itself.
5252
#'
5353
#' @section Fields:
54-
#' Only fields inherited from [PipeOpTaskPreproc]/[`PipeOp`].
54+
#' Only fields inherited from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
5555
#'
5656
#' @section Methods:
57-
#' Methods inherited from [PipeOpTaskPreproc]/[`PipeOp`].
57+
#' Methods inherited from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
5858
#'
5959
#' @family PipeOps
6060
#' @seealso https://mlr3book.mlr-org.com/list-pipeops.html
@@ -76,7 +76,7 @@ PipeOpReweighingWeights = R6Class("PipeOpReweighingWeights",
7676
inherit = mlr3pipelines::PipeOpTaskPreproc,
7777
public = list(
7878
#' @description
79-
#' Creates a new instance of this [R6][R6::R6Class][PipeOp] R6 class.
79+
#' Creates a new instance of this [R6::R6Class][mlr3pipelines::PipeOpTaskPreproc] R6 class.
8080
#'
8181
#' @param id `character` \cr
8282
#' The PipeOps identifier in the PipeOps library.

R/helpers.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#' @param prediction [mlr3::Prediction] A prediction
44
#' @param base_measure [mlr3::Measure] The measure to compute in each group.
55
#' @param task [mlr3::Task] the task prediction was made on.
6-
#' @param ... `any` passed on to respective measure.
7-
#' @return [numeric] Computed score
6+
#' @param ... any passed on to respective measure.
7+
#' @return numeric Computed score
88
#'
99
#' @noRd
1010
score_groupwise = function(prediction, base_measure, task, ...) {
@@ -22,7 +22,7 @@ score_groupwise = function(prediction, base_measure, task, ...) {
2222
#' Compute weights for PipeOpReweighing*
2323
#'
2424
#' @param task [mlr3::Task] the task
25-
#' @param alpha [numeric] Debiasing strength
25+
#' @param alpha numeric Debiasing strength
2626
#'
2727
#' @return [data.table] A data.table with counts and weights for each feature.
2828
#' @noRd

R/mlr_learners_fairness.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#' @name mlr_learners_fairness
33
#'
44
#' @section Predefined measures:
5-
#' \CRANpkg{mlr3fairness} comes with a set of predefined fairn learners listed below:
5+
#' \CRANpkg{mlr3fairness} comes with a set of predefined 'fair learners' listed below:
66
#'
77
#' `r tabular(mlr_learners_fairness)`
88
#'

R/mlr_measures_fairness.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#'
44
#' @section Predefined measures:
55
#' \CRANpkg{mlr3fairness} comes with a set of predefined fairness measures as listed below.
6-
#' For full flexibility, [MeasureFairness] can be used to construct classical
6+
#' For full flexibility, [mlr3fairness::MeasureFairness] can be used to construct classical
77
#' group fairness measures based on a difference between a performance metrics across groups
88
#' by combining a performance measure with an operation for measuring differences.
9-
#' Furthermore [MeasureSubgroup] can be used to measure performance in a given subgroup, or alternatively
9+
#' Furthermore [mlr3fairness::MeasureSubgroup] can be used to measure performance in a given subgroup, or alternatively
1010
#' groupwise_metrics(measure, task) to instantiate a measure for each subgroup in a [mlr3::Task].
1111
#'
1212
#' `r tabular(mlr_measures_fairness)`

R/mlr_pipeops_explicit_pta.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#' @format [R6::R6Class] object inheriting from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
1+
#' @format [R6::R6Class] object inheriting from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].

R/mlr_pipeops_reweighing.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#' @format [R6::R6Class] object inheriting from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].
1+
#' @format [R6::R6Class] object inheriting from [mlr3pipelines::PipeOpTaskPreproc]/[mlr3pipelines::PipeOp].

man/mlr_learners_fairness.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mlr_pipeops_equalized_odds.Rd

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)