shape_dtw_pairwise_distance#
- shape_dtw_pairwise_distance(X: ndarray, y: ndarray = None, window: float = None, descriptor: str = 'identity', reach: int = 30, itakura_max_slope: float = None) ndarray [source]#
Compute the ShapeDTW pairwise distance among a set of series.
- Parameters:
- Xnp.ndarray
A set of time series, either univariate, shape
(n_instances, n_timepoints,)
, or multivariate, shape(n_instances, n_channels, n_timepoints)
.- ynp.ndarray or None, default=None
A single series or a collection of time series of shape
(m_timepoints,)
or(m_instances, m_timepoints)
or(m_instances, m_channels, m_timepoints)
.- windowfloat or None, default=None
The window to use for the bounding matrix. If None, no bounding matrix is used. window is a percentage deviation, so if
window = 0.1
then 10% of the series length is the max warping allowed. is used.- descriptorstr, default=None (if None then identity is used).
Defines which transformation is applied on the sub-sequences. Valid descriptors are: [‘identity’]
Identity is simply a copying mechanism of the sub-sequence, no transformations are done. For now no other descriptors are implemented.
If not specified then identity is used.
- reachint, default=30.
Length of the sub-sequences.
- itakura_max_slopefloat, default=None
Maximum slope as a proportion of the number of time points used to create Itakura parallelogram on the bounding matrix. Must be between 0. and 1.
- Returns:
- np.ndarray
ShapeDTW pairwise matrix between the instances of X of shape
(n_instances, n_instances)
or between X and y of shape(n_instances, n_instances)
.
- Raises:
- ValueError
If x and y are not 1D or 2D arrays.