Learn R Programming

autotab (version 0.1.3)

min_max_scale: 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)

Value

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

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.

See Also

extracting_distribution(), set_feat_dist(), VAE_train()

Examples

Run this code
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))


Run the code above in your browser using DataLab