Learn R Programming

NADIA (version 0.4.2)

PipeOpSimulateMissings: PipeOpSimulateMissings

Description

Generates MCAR missing values in mlr3 pipeline according to set parameters. Missings are inserted to task data once during first training.

Arguments

Input and Output Channels

Input and output channels are inherited from PipeOpTaskPreproc.

Parameters

  • per_missings :: double(1)
    Overall percentage of missing values generated in dataset [0, 100]. Must be set every time, default 50

  • per_instances_missings :: double(1)
    Percentage of instances which will have missing values [0, 100].

  • per_variables_missings :: double(1)
    Percentage of variables which will have missing values [0, 100].

  • variables_missings :: integer
    Only when `per_variables_missings` is `NULL`. Vector of indexes of columns in which missings will be generated.

Super classes

mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> PipeOpSimulateMissings

Methods

Inherited methods


Method new()

Usage

PipeOpSimulateMissings$new(
  id = "simulate_missings",
  param_vals = list(per_missings = 50)
)


Method clone()

The objects of this class are cloneable with this method.

Usage

PipeOpSimulateMissings$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
{
  task_NA <- PipeOpSimulateMissings$new()$train(list(tsk("iris")))[[1]]

  # check
  sum(task_NA$missings()) > 0
}

Run the code above in your browser using DataLab