Learn R Programming

RemixAutoML (version 0.11.0)

ModelDataPrep: Final Data Preparation Function

Description

This function replaces inf values with NA, converts characters to factors, and imputes with constants

Usage

ModelDataPrep(data, Impute = TRUE, CharToFactor = TRUE,
  IntToNumeric = TRUE, RemoveDates = FALSE, MissFactor = "0",
  MissNum = -1, IgnoreCols = NULL)

Arguments

data

This is your source data you'd like to modify

Impute

Defaults to TRUE which tells the function to impute the data

CharToFactor

Defaults to TRUE which tells the function to convert characters to factors

IntToNumeric

Defaults to TRUE which tells the function to convert integers to numeric

RemoveDates

Defaults to FALSE. Set to TRUE to remove date columns from your data.table

MissFactor

Supply the value to impute missing factor levels

MissNum

Supply the value to impute missing numeric values

IgnoreCols

Supply column numbers for columns you want the function to ignore

Value

Returns the original data table with corrected values

See Also

Other Feature Engineering: AutoDataPartition, AutoTransformationCreate, AutoTransformationScore, AutoWord2VecModeler, CreateCalendarVariables, CreateHolidayVariables, DT_GDL_Feature_Engineering, DummifyDT, GDL_Feature_Engineering, Partial_DT_GDL_Feature_Engineering, Scoring_GDL_Feature_Engineering, TimeSeriesFill

Examples

Run this code
# NOT RUN {
data <- data.table::data.table(Value = runif(100000),
                               FactorCol = as.character(sample(x = c(letters,
                                                                     LETTERS,
                                                                     paste0(letters,letters),
                                                                     paste0(LETTERS,LETTERS),
                                                                     paste0(letters,LETTERS),
                                                                     paste0(LETTERS,letters)),
                                                               size = 100000,
                                                               replace = TRUE)))
data <- ModelDataPrep(data,
                      Impute = TRUE,
                      CharToFactor = TRUE,
                      IntToNumeric = TRUE,
                      MissFactor = "0",
                      MissNum    = -1)
# }

Run the code above in your browser using DataLab