Distance benchmarks#
In this example, we compare the performance of dynamic time warping as implemented in wildboar against the implementation in sktime.
[1]:
import warnings
warnings.filterwarnings("ignore")
import numpy as np
from wildboar.distance import pairwise_distance
from sktime.distances import ddtw_distance
[2]:
rnd = np.random.RandomState()
[3]:
x = rnd.randn(10000)
y = rnd.randn(10000)
[4]:
%timeit pairwise_distance(x, y, metric="ddtw", metric_params={"r": 0.5})
304 ms ± 1.28 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
[5]:
%timeit ddtw_distance(x, y, window=0.5)
4.41 s ± 68.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
As we can see, the wildboar implementation is more than one order of magnitude faster than the implementation in sktime.