WindowNormalizer: Window-based streaming normalizalizer

WindowNormalizerR Documentation

Window-based streaming normalizalizer

Description

R6 class allows normalizing the data set in an online manner one-by-one or chunk-by-chunk. It maintains a window with the last data values to calculate the statistical values needed for the min-max normalization or the z-score standardization.

Methods

Public methods


Method new()

Create a new WindowNormalizer object.

Usage
WindowNormalizer$new(wl, method = "z-score", returnPoint = F)
Arguments
wl

Length of the window with historical data values.

method

Normalization method to be used "min-max" or "z-score".

returnPoint

If FALSE then normalized current window is returned, else, normalized current data point is returned.

Returns

A new WindowNormalizer object.


Method normalize()

Normalizes the current data value.

Usage
WindowNormalizer$normalize(x)
Arguments
x

Current data value to be normalized.

Returns

If returnPoint = FALSE then normalized current window is returned, else, normalized current data point is returned.


Method denormalize()

Denormalizes the current data value.

Usage
WindowNormalizer$denormalize(y)
Arguments
y

Current data value to be denormalized.

Returns

Denormalized current data point.

Examples


normalizer <- WindowNormalizer$new(wl = 3)

normalizer$normalize(10)
normalizer$normalize(15)
normalizer$normalize(20)
normalizer$normalize(10)
normalizer$normalize(30)
normalizer$normalize(15)

normalizer$denormalize(-0.3202563)


alaineiturria/otsad documentation built on Jan. 12, 2023, 12:26 p.m.