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: >
Interpretation of the above Plot¶
Heatmap: The central heatmap shows the pairwise distances between the time series in
aandb. Darker colors represent smaller distances, while lighter colors represent larger distances.Blue Plot (Left): This shows the time series
avertically. Each line corresponds to one of the time series ina.Orange Plot (Bottom): This shows the time series
bhorizontally. Each line corresponds to one of the time series inb.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.