stan {ARTtransfer}R Documentation

stan: Standardize Training, Validation, and Test Datasets

Description

This function standardizes the training, validation, and test datasets by centering and scaling them using the mean and standard deviation from the training set. It ensures that the validation and test sets are transformed using the same parameters derived from the training data.

Usage

stan(train, validation = NULL, test = NULL)

Arguments

train

A list containing the training set. The list must have a component 'X' for predictors.

validation

A list containing the validation set. The list must have a component 'X' for predictors. If 'NULL', the validation set is not standardized. Default is 'NULL'.

test

A list containing the test set. The list must have a component 'X' for predictors. If 'NULL', the test set is not standardized. Default is 'NULL'.

Value

A list with the following components:

train

The standardized training set, with predictors centered and scaled.

validation

The standardized validation set (if provided), standardized using the training set's mean and standard deviation.

test

The standardized test set (if provided), standardized using the training set's mean and standard deviation.

Examples

# Example usage
train_data <- list(X = matrix(rnorm(100), ncol=10))
validation_data <- list(X = matrix(rnorm(50), ncol=10))
test_data <- list(X = matrix(rnorm(50), ncol=10))

standardized <- stan(train = train_data, validation = validation_data, test = test_data)


[Package ARTtransfer version 1.0.0 Index]