nnmnkwii.util.minmax_scale

nnmnkwii.util.minmax_scale(x, data_min, data_max, feature_range=(0, 1))[source]

Min/max scaling for given a single data.

Given data min, max and feature range, apply min/max normalization to data.

Parameters:
  • x (array) – Input data
  • data_min (array) – Data min for each feature dimention.
  • data_sax (array) – Data max for each feature dimention.
Returns:

Scaled data.

Return type:

array

Examples

>>> from nnmnkwii.util import minmax, minmax_scale
>>> from nnmnkwii.util import example_file_data_sources_for_acoustic_model
>>> from nnmnkwii.datasets import FileSourceDataset
>>> X, Y = example_file_data_sources_for_acoustic_model()
>>> X, Y = FileSourceDataset(X), FileSourceDataset(Y)
>>> lengths = [len(x) for x in X]
>>> data_min, data_max = minmax(X, lengths)
>>> scaled_x = minmax_scale(X[0], data_min, data_max, feature_range=(0.01, 0.99))

Todo

min’/scale instead of min/max?