prepare_data {fastml}R Documentation

Prepare Data Function

Description

Preprocesses the training and testing data with customizable steps.

Usage

prepare_data(
  train_data,
  test_data,
  label,
  impute_method = "medianImpute",
  encode_categoricals = TRUE,
  scaling_methods = c("center", "scale")
)

Arguments

train_data

Training data frame.

test_data

Testing data frame.

label

Name of the target variable.

impute_method

Method for missing value imputation. Default is "medianImpute". Options include "medianImpute", "knnImpute", "bagImpute", or NULL for no imputation.

encode_categoricals

Logical indicating whether to encode categorical variables. Default is TRUE.

scaling_methods

Vector of scaling methods to apply. Options include "center", "scale", "range", "zv", "nzv", "YeoJohnson", "BoxCox". Default is c("center", "scale").

Value

A list containing preprocessed training and testing data and the preprocessor object.


[Package fastml version 0.1.0 Index]