morphoclass.transforms.scalers.abstract_scaler module¶
The abstract base class for all feature scalers.
-
class
morphoclass.transforms.scalers.abstract_scaler.AbstractFeatureScaler(feature_indices, is_global_feature=False)¶ Bases:
abc.ABCBase abstract class for all feature scalers.
All derived classes must implement the _fit and _transform methods
- Parameters
feature_indices – List of indices of the feature maps to which to apply the scaling.
is_global_feature – Apply scaler to global features rather than node features.
-
fit(dataset, idx=None)¶ Fit the scaler to data.
- Parameters
dataset (morphoclass.data.MorphologyDataset) – Data to which to fit the scaler.
idx – Selects a subset of samples in the dataset to which to fit the data.
-
abstract
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
-
abstract
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.