From 3485877fdab25089847f96afa4fc872502109a6a Mon Sep 17 00:00:00 2001 From: advieser Date: Thu, 6 Feb 2025 18:44:57 +0100 Subject: [PATCH 1/4] small docs corrections --- R/PipeOpTaskPreproc.R | 16 +++++++++++----- man/PipeOpTaskPreproc.Rd | 4 ++-- man/PipeOpTaskPreprocSimple.Rd | 10 ++++++++-- man/mlr_pipeops_kernelpca.Rd | 4 ++-- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/R/PipeOpTaskPreproc.R b/R/PipeOpTaskPreproc.R index f94848f65..d505bcd8e 100644 --- a/R/PipeOpTaskPreproc.R +++ b/R/PipeOpTaskPreproc.R @@ -39,7 +39,6 @@ #' PipeOpTaskPreproc$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, #' packages = character(0), task_type = "Task", tags = NULL, feature_types = mlr_reflections$task_feature_types) #' ``` -#' #' * `id` :: `character(1)`\cr #' Identifier of resulting object. See `$id` slot of [`PipeOp`]. #' * `param_set` :: [`ParamSet`][paradox::ParamSet]\cr @@ -51,14 +50,14 @@ #' Whether the `affect_columns` parameter should be added which lets the user limit the columns that are #' modified by the [`PipeOpTaskPreproc`]. This should generally be `FALSE` if the operation adds or removes #' rows from the [`Task`][mlr3::Task], and `TRUE` otherwise. Default is `TRUE`. -#' * packages :: `character`\cr +#' * `packages` :: `character`\cr #' Set of all required packages for the [`PipeOp`]'s `private$.train()` and `private$.predict()` methods. See `$packages` slot. #' Default is `character(0)`. #' * `task_type` :: `character(1)`\cr #' The class of [`Task`][mlr3::Task] that should be accepted as input and will be returned as output. This #' should generally be a `character(1)` identifying a type of [`Task`][mlr3::Task], e.g. `"Task"`, `"TaskClassif"` or #' `"TaskRegr"` (or another subclass introduced by other packages). Default is `"Task"`. -#' * tags :: `character` | `NULL`\cr +#' * `tags` :: `character` | `NULL`\cr #' Tags of the resulting `PipeOp`. This is added to the tag `"data transform"`. Default `NULL`. #'* `feature_types` :: `character`\cr #' Feature types affected by the `PipeOp`. See `private$.select_cols()` for more information. @@ -324,8 +323,10 @@ PipeOpTaskPreproc = R6Class("PipeOpTaskPreproc", #' #' @section Construction: #' ``` -#' PipeOpTaskPreprocSimple$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, packages = character(0), task_type = "Task") +#' PipeOpTaskPreprocSimple$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, +#' packages = character(0), task_type = "Task", tags = NULL, feature_types = mlr_reflections$task_feature_types) #' ``` +#' #' (Construction is identical to [`PipeOpTaskPreproc`].) #' #' * `id` :: `character(1)`\cr @@ -339,13 +340,18 @@ PipeOpTaskPreproc = R6Class("PipeOpTaskPreproc", #' Whether the `affect_columns` parameter should be added which lets the user limit the columns that are #' modified by the [`PipeOpTaskPreprocSimple`]. This should generally be `FALSE` if the operation adds or removes #' rows from the [`Task`][mlr3::Task], and `TRUE` otherwise. Default is `TRUE`. -#' * packages :: `character`\cr +#' * `packages` :: `character`\cr #' Set of all required packages for the [`PipeOp`]'s `private$.train()` and `private$.predict()` methods. See `$packages` slot. #' Default is `character(0)`. #' * `task_type` :: `character(1)`\cr #' The class of [`Task`][mlr3::Task] that should be accepted as input and will be returned as output. This #' should generally be a `character(1)` identifying a type of [`Task`][mlr3::Task], e.g. `"Task"`, `"TaskClassif"` or #' `"TaskRegr"` (or another subclass introduced by other packages). Default is `"Task"`. +#' * `tags` :: `character` | `NULL`\cr +#' Tags of the resulting `PipeOp`. This is added to the tag `"data transform"`. Default `NULL`. +#'* `feature_types` :: `character`\cr +#' Feature types affected by the `PipeOp`. See `private$.select_cols()` for more information. +#' Defaults to all available feature types. #' #' @section Input and Output Channels: #' Input and output channels are inherited from [`PipeOpTaskPreproc`]. diff --git a/man/PipeOpTaskPreproc.Rd b/man/PipeOpTaskPreproc.Rd index 24628ff0e..205b4a13e 100644 --- a/man/PipeOpTaskPreproc.Rd +++ b/man/PipeOpTaskPreproc.Rd @@ -55,14 +55,14 @@ subclass should have its own \code{param_vals} parameter and pass it on to \code Whether the \code{affect_columns} parameter should be added which lets the user limit the columns that are modified by the \code{\link{PipeOpTaskPreproc}}. This should generally be \code{FALSE} if the operation adds or removes rows from the \code{\link[mlr3:Task]{Task}}, and \code{TRUE} otherwise. Default is \code{TRUE}. -\item packages :: \code{character}\cr +\item \code{packages} :: \code{character}\cr Set of all required packages for the \code{\link{PipeOp}}'s \code{private$.train()} and \code{private$.predict()} methods. See \verb{$packages} slot. Default is \code{character(0)}. \item \code{task_type} :: \code{character(1)}\cr The class of \code{\link[mlr3:Task]{Task}} that should be accepted as input and will be returned as output. This should generally be a \code{character(1)} identifying a type of \code{\link[mlr3:Task]{Task}}, e.g. \code{"Task"}, \code{"TaskClassif"} or \code{"TaskRegr"} (or another subclass introduced by other packages). Default is \code{"Task"}. -\item tags :: \code{character} | \code{NULL}\cr +\item \code{tags} :: \code{character} | \code{NULL}\cr Tags of the resulting \code{PipeOp}. This is added to the tag \code{"data transform"}. Default \code{NULL}. \item \code{feature_types} :: \code{character}\cr Feature types affected by the \code{PipeOp}. See \code{private$.select_cols()} for more information. diff --git a/man/PipeOpTaskPreprocSimple.Rd b/man/PipeOpTaskPreprocSimple.Rd index 465fd86f5..fdcd31d85 100644 --- a/man/PipeOpTaskPreprocSimple.Rd +++ b/man/PipeOpTaskPreprocSimple.Rd @@ -26,7 +26,8 @@ This inherits from \code{\link{PipeOpTaskPreproc}} and behaves essentially the s \section{Construction}{ -\if{html}{\out{
}}\preformatted{PipeOpTaskPreprocSimple$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, packages = character(0), task_type = "Task") +\if{html}{\out{
}}\preformatted{PipeOpTaskPreprocSimple$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, + packages = character(0), task_type = "Task", tags = NULL, feature_types = mlr_reflections$task_feature_types) }\if{html}{\out{
}} (Construction is identical to \code{\link{PipeOpTaskPreproc}}.) @@ -42,13 +43,18 @@ subclass should have its own \code{param_vals} parameter and pass it on to \code Whether the \code{affect_columns} parameter should be added which lets the user limit the columns that are modified by the \code{\link{PipeOpTaskPreprocSimple}}. This should generally be \code{FALSE} if the operation adds or removes rows from the \code{\link[mlr3:Task]{Task}}, and \code{TRUE} otherwise. Default is \code{TRUE}. -\item packages :: \code{character}\cr +\item \code{packages} :: \code{character}\cr Set of all required packages for the \code{\link{PipeOp}}'s \code{private$.train()} and \code{private$.predict()} methods. See \verb{$packages} slot. Default is \code{character(0)}. \item \code{task_type} :: \code{character(1)}\cr The class of \code{\link[mlr3:Task]{Task}} that should be accepted as input and will be returned as output. This should generally be a \code{character(1)} identifying a type of \code{\link[mlr3:Task]{Task}}, e.g. \code{"Task"}, \code{"TaskClassif"} or \code{"TaskRegr"} (or another subclass introduced by other packages). Default is \code{"Task"}. +\item \code{tags} :: \code{character} | \code{NULL}\cr +Tags of the resulting \code{PipeOp}. This is added to the tag \code{"data transform"}. Default \code{NULL}. +\item \code{feature_types} :: \code{character}\cr +Feature types affected by the \code{PipeOp}. See \code{private$.select_cols()} for more information. +Defaults to all available feature types. } } diff --git a/man/mlr_pipeops_kernelpca.Rd b/man/mlr_pipeops_kernelpca.Rd index b4fcb1ce4..4633598b5 100644 --- a/man/mlr_pipeops_kernelpca.Rd +++ b/man/mlr_pipeops_kernelpca.Rd @@ -3,12 +3,12 @@ \name{mlr_pipeops_kernelpca} \alias{mlr_pipeops_kernelpca} \alias{PipeOpKernelPCA} -\title{Kernelized Principle Component Analysis} +\title{Kernelized Principal Component Analysis} \format{ \code{\link[R6:R6Class]{R6Class}} object inheriting from \code{\link{PipeOpTaskPreproc}}/\code{\link{PipeOp}}. } \description{ -Extracts kernel principle components from data. Only affects numerical features. +Extracts kernel principal components from data. Only affects numerical features. See \link[kernlab:kpca]{kernlab::kpca} for details. } \section{Construction}{ From 091996f1f3ddb9fda18bc933a4264b27892378ff Mon Sep 17 00:00:00 2001 From: advieser Date: Thu, 6 Feb 2025 19:13:10 +0100 Subject: [PATCH 2/4] added doc link --- R/PipeOpClassWeights.R | 2 +- man/mlr_pipeops_classweights.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/PipeOpClassWeights.R b/R/PipeOpClassWeights.R index d45d4dd3e..c9d9433c5 100644 --- a/R/PipeOpClassWeights.R +++ b/R/PipeOpClassWeights.R @@ -14,7 +14,7 @@ #' must be adjusted for this [`PipeOp`] to be useful. #' #' Note this only sets the `"weights_learner"` column. -#' It therefore influences the behaviour of subsequent `Learner`s, but does not influence resampling or evaluation metric weights. +#' It therefore influences the behaviour of subsequent [`Learner`][mlr3::Learner]s, but does not influence resampling or evaluation metric weights. #' #' @section Construction: #' ``` diff --git a/man/mlr_pipeops_classweights.Rd b/man/mlr_pipeops_classweights.Rd index 9c733c0a7..a58f9e070 100644 --- a/man/mlr_pipeops_classweights.Rd +++ b/man/mlr_pipeops_classweights.Rd @@ -17,7 +17,7 @@ Caution: when constructed naively without parameter, the weights are all set to must be adjusted for this \code{\link{PipeOp}} to be useful. Note this only sets the \code{"weights_learner"} column. -It therefore influences the behaviour of subsequent \code{Learner}s, but does not influence resampling or evaluation metric weights. +It therefore influences the behaviour of subsequent \code{\link[mlr3:Learner]{Learner}}s, but does not influence resampling or evaluation metric weights. } \section{Construction}{ From 841094594b8b27824f1e58178b1e95bbdf413da2 Mon Sep 17 00:00:00 2001 From: advieser Date: Thu, 6 Feb 2025 19:25:54 +0100 Subject: [PATCH 3/4] removed laconic phrase --- R/PipeOpClassifAvg.R | 2 -- man/mlr_pipeops_classifavg.Rd | 2 -- 2 files changed, 4 deletions(-) diff --git a/R/PipeOpClassifAvg.R b/R/PipeOpClassifAvg.R index 21f3740ab..7f4766a63 100644 --- a/R/PipeOpClassifAvg.R +++ b/R/PipeOpClassifAvg.R @@ -20,8 +20,6 @@ #' equal weights for each prediction. #' Defaults to equal weights for each model. #' -#' If ` -#' #' @section Construction: #' ``` #' PipeOpClassifAvg$new(innum = 0, collect_multiplicity = FALSE, id = "classifavg", param_vals = list()) diff --git a/man/mlr_pipeops_classifavg.Rd b/man/mlr_pipeops_classifavg.Rd index d5d1a32e8..20bf93130 100644 --- a/man/mlr_pipeops_classifavg.Rd +++ b/man/mlr_pipeops_classifavg.Rd @@ -22,8 +22,6 @@ All incoming \code{\link[mlr3:Learner]{Learner}}'s \verb{$predict_type} must agr Weights can be set as a parameter; if none are provided, defaults to equal weights for each prediction. Defaults to equal weights for each model. - -If ` } \section{Construction}{ From df7c9963171cf97ccbb8675258c5a1d4dd180aa6 Mon Sep 17 00:00:00 2001 From: advieser Date: Thu, 6 Feb 2025 19:56:46 +0100 Subject: [PATCH 4/4] docs standardization --- R/PipeOpEncodeImpact.R | 3 ++- R/PipeOpEncodeLmer.R | 6 +++--- man/mlr_pipeops_encodeimpact.Rd | 3 ++- man/mlr_pipeops_encodelmer.Rd | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/R/PipeOpEncodeImpact.R b/R/PipeOpEncodeImpact.R index e3dc6a88c..74ddd0882 100644 --- a/R/PipeOpEncodeImpact.R +++ b/R/PipeOpEncodeImpact.R @@ -43,6 +43,7 @@ #' this feature level on each *outcome level*. #' #' @section Parameters: +#' The parameters are the parameters inherited from [`PipeOpTaskPreproc`], as well as: #' * `smoothing` :: `numeric(1)` \cr #' A finite positive value used for smoothing. Mostly relevant for [classification Tasks][mlr3::TaskClassif] if #' a factor does not coincide with a target factor level (and would otherwise give an infinite logit value). @@ -54,7 +55,7 @@ #' Uses Laplace smoothing, mostly to avoid infinite values for [classification Task][mlr3::TaskClassif]. #' #' @section Methods: -#' Only methods inherited [`PipeOpTaskPreproc`]/[`PipeOp`]. +#' Only methods inherited [`PipeOpTaskPreprocSimple`][`PipeOpTaskPreproc`]/[`PipeOp`]. #' #' @examples #' library("mlr3") diff --git a/R/PipeOpEncodeLmer.R b/R/PipeOpEncodeLmer.R index cef7d32a5..3467bb254 100644 --- a/R/PipeOpEncodeLmer.R +++ b/R/PipeOpEncodeLmer.R @@ -55,11 +55,11 @@ #' List of coefficients learned via `glmer` #' #' @section Parameters: +#' The parameters are the parameters inherited from [`PipeOpTaskPreproc`], as well as: #' * `fast_optim` :: `logical(1)` \cr +#' If `fast_optim` is `TRUE` (default), a faster (up to 50 percent) optimizer from the `nloptr` package is used when +#' fitting the lmer models. This uses additional stopping criteria which can give suboptimal results. #' Initialized to `TRUE`. -#' If "fast_optim" is `TRUE` (default), a faster (up to 50 percent) -#' optimizer from the nloptr package is used when fitting the lmer models. -#' This uses additional stopping criteria which can give suboptimal results. #' #' @section Internals: #' Uses the [`lme4::glmer`]. This is relatively inefficient for features with a large number of levels. diff --git a/man/mlr_pipeops_encodeimpact.Rd b/man/mlr_pipeops_encodeimpact.Rd index cfe211bee..193665690 100644 --- a/man/mlr_pipeops_encodeimpact.Rd +++ b/man/mlr_pipeops_encodeimpact.Rd @@ -56,6 +56,7 @@ this feature level on each \emph{outcome level}. \section{Parameters}{ +The parameters are the parameters inherited from \code{\link{PipeOpTaskPreproc}}, as well as: \itemize{ \item \code{smoothing} :: \code{numeric(1)} \cr A finite positive value used for smoothing. Mostly relevant for \link[mlr3:TaskClassif]{classification Tasks} if @@ -73,7 +74,7 @@ Uses Laplace smoothing, mostly to avoid infinite values for \link[mlr3:TaskClass \section{Methods}{ -Only methods inherited \code{\link{PipeOpTaskPreproc}}/\code{\link{PipeOp}}. +Only methods inherited \code{\link[=PipeOpTaskPreproc]{PipeOpTaskPreprocSimple}}/\code{\link{PipeOp}}. } \examples{ diff --git a/man/mlr_pipeops_encodelmer.Rd b/man/mlr_pipeops_encodelmer.Rd index 518d4707b..14cd2999e 100644 --- a/man/mlr_pipeops_encodelmer.Rd +++ b/man/mlr_pipeops_encodelmer.Rd @@ -68,12 +68,12 @@ List of coefficients learned via \code{glmer} \section{Parameters}{ +The parameters are the parameters inherited from \code{\link{PipeOpTaskPreproc}}, as well as: \itemize{ \item \code{fast_optim} :: \code{logical(1)} \cr +If \code{fast_optim} is \code{TRUE} (default), a faster (up to 50 percent) optimizer from the \code{nloptr} package is used when +fitting the lmer models. This uses additional stopping criteria which can give suboptimal results. Initialized to \code{TRUE}. -If "fast_optim" is \code{TRUE} (default), a faster (up to 50 percent) -optimizer from the nloptr package is used when fitting the lmer models. -This uses additional stopping criteria which can give suboptimal results. } }