************************************** :py:mod:`wildboar.datasets.preprocess` ************************************** .. py:module:: wildboar.datasets.preprocess .. autoapi-nested-parse:: Utilities for preprocessing time series. .. !! processed by numpydoc !! Module Contents --------------- Functions --------- .. autoapisummary:: wildboar.datasets.preprocess.maxabs_scale wildboar.datasets.preprocess.minmax_scale wildboar.datasets.preprocess.named_preprocess wildboar.datasets.preprocess.standardize wildboar.datasets.preprocess.truncate .. py:function:: maxabs_scale(x) 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 samples. :Returns: ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep) The transformed samples. .. !! processed by numpydoc !! .. py:function:: minmax_scale(x, min=0, max=1) Scale x along the time dimension. Each time series is scaled such 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 samples. **min** : float, optional The minimum value. **max** : float, optional The maximum value. :Returns: ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep) The transformed samples. .. !! processed by numpydoc !! .. py:function:: named_preprocess(name) Get a named preprocessor. :Parameters: **name** : str The name of the preprocessor. :Returns: callable The preprocessor function. .. !! processed by numpydoc !! .. py:function:: standardize(x) Scale x along the time dimension. The resulting array will have zero mean and unit standard deviation. :Parameters: **x** : ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep) The samples. :Returns: ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep) The standardized samples. .. !! processed by numpydoc !! .. py:function:: truncate(x, n_shortest=None) Truncate x to the shortest sequence. :Parameters: **x** : ndarray of shape (n_samples, n_timestep) or (n_samples, n_dims, n_timestep) The samples. **n_shortest** : int, optional The maximum size. :Returns: ndarray of shape (n_samples, n_shortest) or (n_samples, n_dims, n_shortest) The truncated samples. .. !! processed by numpydoc !!