morphoclass.transforms.scalers.standard_scaler module¶
Implementation of the standard scaler transform.
-
class
morphoclass.transforms.scalers.standard_scaler.FeatureStandardScaler(feature_indices, with_mean=True, with_std=True, **kwargs)¶ Bases:
morphoclass.transforms.scalers.abstract_scaler.AbstractFeatureScalerScaler that removes the mean and standard deviation.
Internally the StandardScaler from scikit-learn is applied
- Parameters
feature_indices – List of indices of the feature maps to which to apply the scaling.
with_mean (bool (optional)) – Whether or not to shift by the mean value. This value is passed through to the StandardScaler class in sklearn.
with_std (bool (optional)) – Whether or not to scale by the standard deviation. This value is passed through to the StandardScaler class in sklearn.
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.