preProcessData | R Documentation |
This function preprocesses a dataset by applying a variety of transformation methods, such as centering, scaling, or imputation. Users can also specify columns to exclude from preprocessing. The function supports a variety of preprocessing methods, including dimensionality reduction and imputation techniques, and ensures proper method application order.
preProcessData(
data,
outcome,
excludeClasses,
methods = c("center", "scale"),
settings
)
data |
A data frame or matrix representing the dataset to be preprocessed. |
outcome |
A character string representing the outcome variable, if any, for outcome-based transformations. |
excludeClasses |
A character vector specifying the column names to exclude from
preprocessing. Default is |
methods |
A character vector specifying the preprocessing methods to apply.
Default methods are |
settings |
A named list containing settings for the analysis. If NULL, defaults will be used. The settings list may contain:
- |
The function applies various transformations to the dataset as specified by the user. It ensures
that methods are applied in the correct order to maintain data integrity and consistency. If fewer
than two columns remain after excluding specified columns, the function halts and returns NULL
.
The function also handles categorical columns by skipping their transformation. Users can also
specify outcome variables for specialized preprocessing.
A list containing:
processedMat
: The preprocessed dataset.
preprocessParams
: The preprocessing parameters that were applied to the dataset.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.