wildboar.datasets.preprocess#

Module Contents#

Functions#

maxabs_scale(x)

Scale each time series by its maximum absolute value.

minmax_scale(x[, min, max])

Scale x along the time dimension so that each value is between min and max

named_preprocess(name)

standardize(x)

Scale x along the time dimension to have zero mean and unit standard deviation

truncate(x[, n_shortest])

Truncate x to the shortest sequence.

wildboar.datasets.preprocess.maxabs_scale(x)[source]#

Scale each time series by its maximum absolute value.

Parameters:

x (ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)) – The dataset

Returns:

x – The transformed dataset

Return type:

ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)

wildboar.datasets.preprocess.minmax_scale(x, min=0, max=1)[source]#

Scale x along the time dimension so that each value is between min and max

Parameters:
  • x (ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)) – The dataset

  • min (float, optional) – The minimum value

  • max (float, optional) – The maximum value

Returns:

x – The transformed dataset

Return type:

ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)

wildboar.datasets.preprocess.named_preprocess(name)[source]#
wildboar.datasets.preprocess.standardize(x)[source]#

Scale x along the time dimension to have zero mean and unit standard deviation

Parameters:

x (ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)) – The dataset

Returns:

x – The standardized dataset

Return type:

ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)

wildboar.datasets.preprocess.truncate(x, n_shortest=None)[source]#

Truncate x to the shortest sequence.

Parameters:
  • x (ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep)) – The dataset

  • n_shortest (int, optional) – The maximum size

Returns:

x – The truncated dataset

Return type:

ndarray of shape (n_samples, n_shortest) or (n_samples, n_dims, n_shortest)