Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ Example
distance, path = fastdtw(x, y, dist=euclidean)
print(distance)


Example parallel computing
-------

::

import numpy as np
from scipy.spatial.distance import euclidean

from fastdtw import fastdtw_parallel, get_path

X = np.random.randint(1, 40, size=(5, 5))
distance_matrix, path_list = fastdtw_parallel(X, dist=euclidean, n_jobs=-1)
print(distance_matrix)

# To allow the straight forward access of warp paths to the respective distance matrix element
# the get_path function can be used
# Access the path for distance matrix element with index row=2 and column=3
print(get_path(path_list, 2, 3)

References
----------

Expand Down
4 changes: 2 additions & 2 deletions fastdtw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from ._fastdtw import fastdtw, dtw
from ._fastdtw import fastdtw, dtw, dtw_parallel, fastdtw_parallel, get_path
except ImportError:
from .fastdtw import fastdtw, dtw
from .fastdtw import fastdtw, dtw, dtw_parallel, fastdtw_parallel, get_path
Loading