morphoclass.transforms.scalers.manual_scaler module

Implementation of the manual scaler transform.

class morphoclass.transforms.scalers.manual_scaler.FeatureManualScaler(feature_indices, shift=0, scale=1, **kwargs)

Bases: morphoclass.transforms.scalers.abstract_scaler.AbstractFeatureScaler

Scaler that shifts and scales the features by fixed values.

The new features are computed by features -> (features - shift) / scale

Parameters
  • feature_indices – List of indices of the feature maps to which to apply the scaling.

  • shift (float) – The fixed offset subtracted from the features

  • scale (float) – The fixed scale by which the shifted features are divided.

  • kwargs – Additional keyword argument to pass through to the AbstractFeatureScaler base class.

get_config()

Generate the configuration necessary for reconstructing the scaler.

Returns

config – The configuration of the scaler. It should contain all information necessary for reconstructing the scaler using the scaler_from_config function.

Return type

dict

reconstruct(params)

Reconstruct the configuration from parameters.

Parameters

params (dict) – The parameters found in config[“params”] with the config being the dictionary returned by get_config.