Learn R Programming

NADIA (version 0.4.2)

PipeOpVIM_kNN: PipeOpVIM_kNN

Description

Implements KNN methods as mlr3 pipeline, more about VIM_KNN autotune_VIM_kNN.

Arguments

Input and Output Channels

Input and output channels are inherited from PipeOpImpute.

Parameters

The parameters include inherited from [`PipeOpImpute`], as well as:

  • id :: character(1)
    Identifier of resulting object, default "imput_VIM_kNN".

  • k :: intiger(1)
    Threshold for convergence, default 5.

  • numFUN :: function(){}
    Function for aggregating the k Nearest Neighbours in the case of a numerical variable. Can be ever function with input=numeric_vector and output=atomic_object, default median.

  • catFUN :: function(){}
    Function for aggregating the k Nearest Neighbours in case of categorical variables. It can be any function with input=not_numeric_vector and output=atomic_object, default VIM::maxCat

  • out_fill :: character(1)
    Output log file location. If file already exists log message will be added. If NULL no log will be produced, default NULL.

Super classes

mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpImpute -> VIM_kNN_imputation

Methods

Inherited methods


Method new()

Usage

PipeOpVIM_kNN$new(
  id = "impute_VIM_kNN_B",
  k = 5,
  numFun = median,
  catFun = VIM::maxCat,
  out_file = NULL
)


Method clone()

The objects of this class are cloneable with this method.

Usage

PipeOpVIM_kNN$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
{
  graph <- PipeOpVIM_kNN$new() %>>% mlr3learners::LearnerClassifGlmnet$new()
  graph_learner <- GraphLearner$new(graph)

  # Task with NA

  resample(tsk("pima"), graph_learner, rsmp("cv", folds = 3))
}

Run the code above in your browser using DataLab