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: Returns: Scaled data.
Return type: 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?