Impute features by their mode. Supports factors as well as logical and numerical features. If multiple modes are present then imputed values are sampled randomly from them.
R6Class object inheriting from
PipeOpImputeMode$new(id = "imputemode", param_vals = list())
Identifier of resulting object, default
param_vals :: named
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction. Default
Input and output channels are inherited from
The output is the input
Task with all affected features missing values imputed by (column-wise) mode.
$state is a named
list with the
$state elements inherited from
$state$model is a named
list of a vector of length one of the type of the feature, indicating the mode of the respective feature.
The parameters are the parameters inherited from
Features that are entirely
NA are imputed as
the following: For
ordered, random levels are sampled uniformly at random.
FALSE are sampled uniformly at random.
Numerics and integers are imputed as
Note that every random imputation is drawn independently, so different values may be imputed if multiple values are missing.
Only methods inherited from
Other Imputation PipeOps:
library("mlr3") task = tsk("pima") task$missings() po = po("imputemode") new_task = po$train(list(task = task))[] new_task$missings() po$state$model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.