Description Usage Arguments Value Author(s) Examples
View source: R/apply_impute_mappings.R
Uses output from map.impute to impute NA values in a dataframe. Also creates tracking features to indicate which observations had NA values.
1 2 | apply.impute.mappings(data, impute.mappings, impute.mode = "auto",
na.threshold = 0.1, track.features = TRUE, progress = TRUE)
|
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 |
Data frame with imputed original features and tracking features
Xander Horn
1 2 | imp <- map.impute(data = iris)
new_iris <- apply.impute.mappings(iris, imp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.