stanza.analysis.preprocessing

Module Contents

Functions

NameDescription
normalizeNormalize array values to the range [0, 1] using min-max scaling.

API

1stanza.analysis.preprocessing.normalize(a: numpy.ndarray) -> numpy.ndarray

Normalize array values to the range [0, 1] using min-max scaling.

Applies linear transformation to scale all values in the input array to the [0, 1] range. The minimum value in the array maps to 0, and the maximum value maps to 1. This is useful for standardizing data ranges before curve fitting or other numerical operations.

Parameters:

a
numpy.ndarray

Input array to normalize

Returns:

Normalized array with values in [0, 1]. If the input is a constant array (all values equal), returns an array of zeros with the same shape and float dtype.