baybe.targets.transforms.triangular_transform

baybe.targets.transforms.triangular_transform(arr: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], lower: float, upper: float)[source]

Map values to the interval [0, 1] in a “triangular” fashion.

The shape of the function is “triangular” in that is 0 outside a specified interval and linearly increases to 1 from both interval ends, reaching the value 1 at the center of the interval.

Parameters:
Return type:

ndarray

Returns:

A new array containing the transformed values.