DataScalerBase Class

Abstract Base Class for Data Scalers

class spiegelib.features.DataScalerBase

Bases: abc.ABC

abstract fit(data, axis=None)

Fit parameters for data scaling. Abstract, must be implemented.

Parameters
  • data (np.ndarray) – data to calculate mean and standard deviation on for future scaling

  • axis (int, tuple, optional) – axis or axes to use for calculating scaling parameteres. Defaults to None which will flatten the array first.

abstract transform(data)

Scale data

Parameters

data (np.ndarray) – data to scale

Returns

scaled data

Return type

np.ndarray

fit_transform(data, axis=None)

Fit scaling parameters and then scale data

Parameters
  • data (np.ndarray) – data to scale

  • axis (int, tuple, optional) – axis or axes to use for calculating scaling parameteres. Defaults to None which will flatten the array first.

Returns

scaled data

Return type

np.ndarray