Time series distances#

The aeon.distances module contains time series specific distance functions that can be used in aeon and scikit learn estimators. It also contains tools for extracting the alignment paths for a distance calculation between two series, and tools for finding all pairwise distances

Dynamic Time Warping (DTW)#

dtw_distance(x, y[, window])

Compute the dtw distance between two time series.

dtw_pairwise_distance(X[, y, window])

Compute the dtw pairwise distance between a set of time series.

dtw_cost_matrix(x, y[, window])

Compute the dtw cost matrix between two time series.

dtw_alignment_path(x, y[, window])

Compute the dtw alignment path between two time series.

Time Warp Edit (TWE)#

twe_distance(x, y[, window, nu, lmbda])

Compute the TWE distance between two time series.

twe_pairwise_distance(X[, y, window, nu, lmbda])

Compute the twe pairwise distance between a set of time series.

twe_alignment_path(x, y[, window, nu, lmbda])

Compute the twe alignment path between two time series.

twe_cost_matrix(x, y[, window, nu, lmbda])

Compute the TWE cost matrix between two time series.

Move-Split-Merge (MSM)#

Derivative Dynamic Time Warping (DDTW)#

ddtw_distance(x, y[, window])

Compute the ddtw distance between two time series.

ddtw_pairwise_distance(X[, y, window])

Compute the ddtw pairwise distance between a set of time series.

ddtw_alignment_path(x, y[, window])

Compute the ddtw alignment path between two time series.

ddtw_cost_matrix(x, y[, window])

Compute the ddtw cost matrix between two time series.

Weighted Dynamic Time Warping (DTW)#

wdtw_distance(x, y[, window, g])

Compute the wdtw distance between two time series.

wdtw_pairwise_distance(X[, y, window, g])

Compute the wdtw pairwise distance between a set of time series.

wdtw_cost_matrix(x, y[, window, g])

Compute the wdtw cost matrix between two time series.

wdtw_alignment_path(x, y[, window, g])

Compute the wdtw alignment path between two time series.

Weighted Derivative Dynamic Time Warping (WDDTW)#

wddtw_distance(x, y[, window, g])

Compute the wddtw distance between two time series.

wddtw_pairwise_distance(X[, y, window, g])

Compute the wddtw pairwise distance between a set of time series.

wddtw_alignment_path(x, y[, window, g])

Compute the wddtw alignment path between two time series.

wddtw_cost_matrix(x, y[, window, g])

Compute the wddtw cost matrix between two time series.

Longest Common Subsequence (LCSS)#

lcss_distance(x, y[, window, epsilon])

Return the lcss distance between x and y.

lcss_pairwise_distance(X[, y, window, epsilon])

Compute the lcss pairwise distance between a set of time series.

lcss_alignment_path(x, y[, window, epsilon])

Compute the lcss alignment path between two time series.

lcss_cost_matrix(x, y[, window, epsilon])

Return the lcss cost matrix between x and y.

Edit Real Penalty (ERP)#

erp_distance(x, y[, window, g, g_arr])

Compute the ERP distance between two time series.

erp_pairwise_distance(X[, y, window, g, g_arr])

Compute the erp pairwise distance between a set of time series.

erp_alignment_path(x, y[, window, g, g_arr])

Compute the erp alignment path between two time series.

erp_cost_matrix(x, y[, window, g, g_arr])

Compute the ERP cost matrix between two time series.

Edit distance for real sequences (EDR)#

edr_distance(x, y[, window, epsilon])

Compute the edr distance between two time series.

edr_pairwise_distance(X[, y, window, epsilon])

Compute the pairwise edr distance between a set of time series.

edr_alignment_path(x, y[, window, epsilon])

Compute the edr alignment path between two time series.

edr_cost_matrix(x, y[, window, epsilon])

Compute the edr cost matrix between two time series.

General methods with distance argument#

distance(x, y, metric, **kwargs)

Compute the distance between two time series.

pairwise_distance(x[, y, metric])

Compute the pairwise distance matrix between two time series.

alignment_path(x, y, metric, **kwargs)

Compute the alignment path and distance between two time series.

cost_matrix(x, y, metric, **kwargs)

Compute the alignment path and distance between two time series.

General methods to recover distance functions#

get_cost_matrix_function(metric)

Get the cost matrix function for a given metric string or callable.

get_distance_function(metric)

Get the distance function for a given metric string or callable.

get_pairwise_distance_function(metric)

Get the pairwise distance function for a given metric string or callable.

get_alignment_path_function(metric)

Get the alignment path function for a given metric string or callable.