MinMaxScaling

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

Bases: _ScopedMethod

Scale features to [0, 1].

The usual final step of a voxel-level chain: distance-based clustering treats every feature dimension as commensurable, which is only true once the dimensions share a range.

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

Learn the scaling bounds.

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

Parameters:
  • block – Matrix to transform.

  • state – State from fit().

Returns:

The scaled matrix.

Examples using habit.feature_preprocessing.MinMaxScaling

Preprocessing features before clustering

Preprocessing features before clustering