RobustScaling

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 RobustScaling(across_features: bool = False)[source]

Bases: _ScopedMethod

Centre features on the median and scale by the interquartile range.

The outlier-resistant standardisation. Useful on radiomics features, where a handful of supervoxels can carry values orders of magnitude away from the bulk.

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

Learn the median and interquartile range.

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 robust scaling.

Parameters:
  • block – Matrix to transform.

  • state – State from fit().

Returns:

The robust-scaled matrix.

Examples using habit.feature_preprocessing.RobustScaling

Preprocessing voxel texture before clustering

Preprocessing voxel texture before clustering