Distances Plotting

This is a simple notebook displaying some of the visualisation functionalities for plotting time series available in aeon.

This is in-progress, and does not contain detailed descriptions and documentation yet.

[1]:
from aeon.datasets import load_gunpoint

Pairwise Distance Matrix

A pairwise distance matrix is a 2D array where each cell (i, j) represents the distance between the i-th element of time series a and the j-th element of time series b.

[2]:
from aeon.distances import euclidean_pairwise_distance
from aeon.visualisation import plot_pairwise_distance_matrix
[3]:
X, y = load_gunpoint(split="test", return_type="numpy2D")

# Subsets of the time series
a = X[0:5, :10]  # First 5 time series with 10 timepoints
b = X[10:15, :10]  # Next 5 time series with 10 timepoints
[4]:
a.shape, b.shape
[4]:
((5, 10), (5, 10))
[5]:
# Compute the pairwise distance matrix between the time series
# in `a` and `b` using Euclidean pairwise distance

distance_matrix = euclidean_pairwise_distance(a, b)

path = [(i, i) for i in range(len(a))]
[6]:
plot_pairwise_distance_matrix(distance_matrix, a, b, path)
[6]:
<Axes: >
../_build/doctrees/nbsphinx/examples_visualisation_plotting_distances_7_1.png

Interpretation of the above Plot

  • Heatmap: The central heatmap shows the pairwise distances between the time series in a and b. Darker colors represent smaller distances, while lighter colors represent larger distances.

  • Blue Plot (Left): This shows the time series a vertically. Each line corresponds to one of the time series in a.

  • Orange Plot (Bottom): This shows the time series b horizontally. Each line corresponds to one of the time series in b.

  • Red Path: The red path highlights the alignment between the time series. In this case, it is a diagonal path for demonstration purposes.


Generated using nbsphinx. The Jupyter notebook can be found here.

binder