min_max_scale: Min–max scale continuous variables

View source: R/utils-globals.R

min_max_scaleR Documentation

Min–max scale continuous variables

Description

Scales numeric vectors to the [0, 1] range using the formula:

(x - \min(x)) / (\max(x) - \min(x))

Usage

min_max_scale(x)

Arguments

x

Numeric vector. Continuous variable(s) to scale.

Details

This is the recommended preprocessing step for continuous variables prior to VAE training with AutoTab, ensuring all inputs are on comparable scales to binary and categorical features.

  • The transformation is performed column-wise when applied to data frames.

Value

Numeric vector of the same length as x, scaled to [0, 1].

See Also

extracting_distribution(), set_feat_dist(), VAE_train()

Examples

x <- c(10, 20, 30)
min_max_scale(x)

# Apply to multiple columns
data <- data.frame(age = c(20, 40, 60), income = c(3000, 5000, 7000))
Continuous_MinMaxScaled = as.data.frame(lapply(data, min_max_scale))



autotab documentation built on March 26, 2026, 1:06 a.m.