apply.impute.mappings: Applies imputation mappings

Description Usage Arguments Value Author(s) Examples

View source: R/apply_impute_mappings.R

Description

Uses output from map.impute to impute NA values in a dataframe. Also creates tracking features to indicate which observations had NA values.

Usage

1
2
apply.impute.mappings(data, impute.mappings, impute.mode = "auto",
  na.threshold = 0.1, track.features = TRUE, progress = TRUE)

Arguments

data

[required | data.frame] Dataset containing features to impute

impute.mappings

[required | list] Output from function map.impute

impute.mode

[optional | character | default="auto"] Imputation mode, options are auto, encode and median.mode. Auto applies a combination bewteen encoding and median.mode imputation based on the na.threshold parameter

na.threshold

[optional | numeric | default=0.1] Threshold for auto impute.mode to apply encoding or median.mode imputation. All features containing Na values above the specified percentage threshold will be imputed using encoding

track.features

[optional | logical | default=TRUE] Creates tracking features that records which observations had NA values present

progress

[optional | logical | default=TRUE] Display a progress bar

Value

Data frame with imputed original features and tracking features

Author(s)

Xander Horn

Examples

1
2
imp <- map.impute(data = iris)
new_iris <- apply.impute.mappings(iris, imp)

XanderHorn/lazy documentation built on Jan. 16, 2021, 6:15 p.m.