Clip#

class sdm.processing.numerical.Clip(min_value: float, max_value: float, *, method: Literal['saturate', 'hard'] = 'hard')#

Bases: Processor, InvertibleMixin

Clip numerical values to a fixed interval.

With method="hard", values are clamped to the interval. With method="saturate", values are mapped smoothly into the interval:

\[y = \frac{x}{\sqrt{1 + (x / b)^2}}\]

where \(b\) is max_value and min_value must equal -max_value. NaN is preserved and infinities map to the endpoints. Inverse transformation leaves values unchanged.

Parameters:
  • min_value (float) – Inclusive lower bound for every numerical value.

  • max_value (float) – Inclusive upper bound for every numerical value.

  • method (Literal['saturate', 'hard']) – "hard" clamps to the bounds; "saturate" approaches finite, nonzero symmetric bounds smoothly and also changes interior values.

Capabilities#

Handled Semantic Types

numerical

Requires Fitting

❌