Dynamic time warping metrics.
Dynamic time warping (DTW) is an algorithm used to measure similarity between different data series, which may vary in speed.
Setup via Makefile:
-
Clone the repository first.
-
Help and overview of commands:
make help -
Setup (Create the venv, install libraries and pull minimal data setup):
make setup
-
Activate Python venv:
make venv
-
Clean project:
make clean
- Poetry is used for the virtual Python environment.
-
Install python poetry:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | pythonor
pip install --user poetry
-
Make sure that the virtual environment is installed in the root folder of this projects:
poetry config virtualenvs.in-project true -
Install dependencies:
poetry install --no-root
-
Add packages: To add further packages, run:
poetry add <package-name>
-
-
Formatting via pre-commit hook: Python code is formatted using pre-commit hooks.
-
Install pre-commit:
pip install pre-commit
or
brew install pre-commit
-
Install pre-commit hooks from the config file .pre-commit-config.yaml
pre-commit install
-
Run the pre-commit hooks:
pre-commit run -a
Testing is done with pytest. The pytest package is already installed in the poetry venv.
-
Run all tests:
pytest
-
Run individual tests:
pytest <path-to-test-files>
- Example files in
/examples/
Fig 1: Compared time series and warped sequence.
Fig 2: Cost matrix and optimal warping path.
Fig 3: Accumulated cost matrix and optimal warping path.
Fig 1: Compared time series and warped sequence.
Fig 2: Cost matrix and optimal warping path.
Fig 3: Accumulated cost matrix and optimal warping path.
- Müller, Meinard. Information retrieval for music and motion. Vol. 2. Heidelberg: Springer, 2007. https://doi.org/10.1007/978-3-540-74048-3