QuantileTransform

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 QuantileTransform(across_features: bool = False, n_quantiles: int = 1000, output_distribution: str = 'uniform')[source]

Bases: object

Map each feature onto a uniform or normal distribution by percentile rank.

Distance-based clustering then sees comparable marginals even when one radiomics column is heavy-tailed and another is bounded. Knots are learned at fit time; prediction rows are interpolated and clipped to the training extrema.

__init__(across_features: bool = False, n_quantiles: int = 1000, output_distribution: str = 'uniform') → None[source]
property spec: Spec

Return the algorithm specification.

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

Learn quantile knots.

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 quantile map.

Parameters:
  • block – Matrix to transform.

  • state – State from fit().

Returns:

The rank-mapped matrix.