Description Usage Arguments Value
Impute multiple missing columns using lm, mean, or xgboost, and perform imputation
1 2 | pipe_impute(train, columns, na_function = is.na, exclude_columns,
type = "lm", controls = NA, verbose = F)
|
train |
The train dataset, as a data.frame or data.table. Data.tables may be changed by reference. |
columns |
The columns to impute, as strings. |
na_function |
A function which returns TRUE when a value is missing and FALSE otherwise. Will apply this function to each column. Must take one column vector as input. |
exclude_columns |
Columns that should not be used in imputation. If lm is chosen, this will always include |
type |
lm, mean, or xgboost. |
controls |
Controls for xgboost, if needed. Default to NA. |
verbose |
Whether xgboost should print anything. |
A list containing the transformed train dataset and a trained pipe.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.