frlearn.transformations.contract

frlearn.transformations.contract(x, c: float = 1)[source]

Strictly order-preserving function from [-∞, ∞] to [0, 1] that sends -∞, -c, 0, c, ∞ to 0, 0.25, 0.5, 0.75, 1, respectively.

Parameters
xfloat

Input value. Should be in [-∞, ∞].

cfloat = 1

The secondary ‘central’ value that is sent to 0.75 (-c is sent to 0.25). Should be in (0, ∞).

Returns
yfloat

Output value in [0, 1].