preProcessResample: Pre-process and Resample Dataset

View source: R/utils.R

preProcessResampleR Documentation

Pre-process and Resample Dataset

Description

This function applies pre-processing transformations to the dataset, then resamples it. Pre-processing parameters are estimated strictly from the training dataset (datasetData), and optionally applied to a separate test dataset (testData) to prevent data leakage.

Usage

preProcessResample(
  datasetData,
  preProcess,
  selectedOutcomeColumns,
  outcome_and_classes,
  settings,
  testData = NULL
)

Arguments

datasetData

Dataframe to be pre-processed (e.g. training data).

preProcess

Vector of pre-processing methods to apply.

selectedOutcomeColumns

Character vector of outcome columns.

outcome_and_classes

List of outcomes and their classes.

settings

A named list containing settings for the analysis. If NULL, defaults will be used. The settings list may contain:

  • seed: An integer seed value for reproducibility.

testData

Optional dataframe of test data to be pre-processed using the parameters estimated from datasetData. Default is NULL.

Value

A list containing:

  • preProcessMapping: The pre-processing mapping (e.g. PCA rotation matrix if applicable).

  • datasetData: The pre-processed training dataset.

  • testData: The pre-processed test dataset (if testData was provided, otherwise NULL).

  • preprocessParams: A list containing the fitted preprocessing parameter objects (impute and transform).


immunaut documentation built on Sept. 10, 2026, 5:09 p.m.