MaxAbsScaling

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

class MaxAbsScaling(across_features: bool = False)[source]

Bases: _ScopedMethod

Scale features by the maximum absolute value.

Leaves zeros at zero and does not shift the origin, so sparse or already-centered radiomics columns keep their sign. A zero-peak column divides by 1.0.

fit(block: DataFrame) → Dict[str, Any][source]

Learn the max-absolute peaks.

Parameters:

block – Unit-by-feature matrix to learn from.

Returns:

State to pass to transform().

transform(block: DataFrame, state: Mapping[str, Any]) → DataFrame[source]

Apply the learned max-absolute scaling.

Parameters:
  • block – Matrix to transform.

  • state – State from fit().

Returns:

The scaled matrix.