var_scale: Variable Scaling

Description Usage Arguments Examples

View source: R/one_hot.R

Description

scaling variables using standardization or normalization

Usage

1
var_scale(dt, var_skip = NULL, type = "standard", ...)

Arguments

dt

a data frame or vector

var_skip

Name of variables that will skip for scaling Defaults to NULL.

type

type of scaling method, including standard or minmax.

...

Additional parameters.

Examples

1
2
3
4
5
6
7
8
data("germancredit")

# standardization
dts1 = var_scale(germancredit, type = 'standard')

# normalization/minmax
dts2 = var_scale(germancredit, type = 'minmax')
dts2 = var_scale(germancredit, type = 'minmax', new_range = c(-1, 1))

scorecard documentation built on Aug. 30, 2020, 5:06 p.m.