Skip to contents

Min-max feature scaling (Geron Ch 2, morie.fn grmms)

Usage

morie_geron_minmax_scaler(X, feature_range = c(0, 1))

Arguments

X

Numeric vector or matrix.

feature_range

Increasing length-2 target range.

Value

List with scaled, data_min, data_max, data_range, scale.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_minmax_scaler(V)
#> $scaled
#> [1] 0.0000000 0.1428571 0.2857143 0.4285714 0.5714286 0.7142857 0.8571429
#> [8] 1.0000000
#> 
#> $data_min
#> [1] 1
#> 
#> $data_max
#> [1] 8
#> 
#> $data_range
#> [1] 7
#> 
#> $scale
#> [1] 0.1428571
#> 
#> $feature_range
#> [1] 0 1
#> 
#> $estimate
#> [1] 0.0000000 0.1428571 0.2857143 0.4285714 0.5714286 0.7142857 0.8571429
#> [8] 1.0000000
#> 
#> $n
#> [1] 8
#>