normalize_vec: Normalize to Range (0, 1)

Description Usage Arguments Details See Also Examples

View source: R/vec-normalize.R

Description

Normalization is commonly used to center and scale numeric features to prevent one from dominating in algorithms that require data to be on the same scale.

Usage

1
2
3

Arguments

x

A numeric vector.

min

The population min value in the normalization process.

max

The population max value in the normalization process.

silent

Whether or not to report the automated min and max parameters as a message.

Details

Standardization vs Normalization

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(dplyr)
library(timetk)

d10_daily <- m4_daily %>% filter(id == "D10")

# --- VECTOR ----

value_norm <- normalize_vec(d10_daily$value)
value      <- normalize_inv_vec(value_norm,
                                min = 1781.6,
                                max = 2649.3)

# --- MUTATE ----

m4_daily %>%
    group_by(id) %>%
    mutate(value_norm = normalize_vec(value))

timetk documentation built on Jan. 19, 2021, 1:06 a.m.