{"id":21768310,"url":"https://github.com/ymtoo/ts-dist","last_synced_at":"2025-06-23T18:08:31.592Z","repository":{"id":53860272,"uuid":"153758139","full_name":"ymtoo/ts-dist","owner":"ymtoo","description":"Time series distance measures","archived":false,"fork":false,"pushed_at":"2022-04-05T09:35:15.000Z","size":18,"stargazers_count":24,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T15:49:18.874Z","etag":null,"topics":["distance-measure","dynamic-time-warping","edit-distance-on-real-sequence","longest-common-subsequence","time-series"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ymtoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-19T09:22:57.000Z","updated_at":"2023-08-04T20:10:48.000Z","dependencies_parsed_at":"2022-08-23T12:11:03.167Z","dependency_job_id":null,"html_url":"https://github.com/ymtoo/ts-dist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ymtoo/ts-dist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymtoo%2Fts-dist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymtoo%2Fts-dist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymtoo%2Fts-dist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymtoo%2Fts-dist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ymtoo","download_url":"https://codeload.github.com/ymtoo/ts-dist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymtoo%2Fts-dist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261528682,"owners_count":23172755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distance-measure","dynamic-time-warping","edit-distance-on-real-sequence","longest-common-subsequence","time-series"],"created_at":"2024-11-26T13:35:27.700Z","updated_at":"2025-06-23T18:08:31.559Z","avatar_url":"https://github.com/ymtoo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-dist\nThe module contains Python implementations of distance measures between two real time series feature vectors. Faster Cython implementations are also provided.\n\n## Distance measures\nThe following distance measures have been implemented.\n* Dynamic Time Warping (DTW) [1]\n* Longest Common Subsequence (LCSS) [2]\n* Edit Distance on Real sequence (EDR) [3]\n\n## Example\n```python\nimport numpy as np\nimport pyximport; pyximport.install()\n\nfrom ts_dist import dtw_dist as dtw_dist_py\nfrom ts_dist import lcss_dist as lcss_dist_py\nfrom ts_dist import edr_dist as edr_dist_py\n\nfrom ts_dist_cy import dtw_dist as dtw_dist_cy\nfrom ts_dist_cy import lcss_dist as lcss_dist_cy\nfrom ts_dist_cy import edr_dist as edr_dist_cy\n\nx = np.random.normal(0, 1, (1000))\ny = np.random.normal(0, 1, (1000))\n\ndtw_py = dtw_dist_py(x, y)\ndtw_cy = dtw_dist_cy(x, y)\n\nlcss_py = lcss_dist_py(x, y, delta=np.inf, epsilon=0.5)\nlcss_cy = lcss_dist_cy(x, y, delta=np.inf, epsilon=0.5)\n\nedr_py = edr_dist_py(x, y, epsilon=0.5)\nedr_cy = edr_dist_cy(x, y, epsilon=0.5)\n```\n\n## Benchmark\n```bash\n$ python benchmark_ts_dist.py\nAverage time taken for dtw_dist_py: 0.15160710269992705\nAverage time taken for dtw_dist_cy: 0.022138842300046237\nAverage time taken for lcss_dist_py: 0.10573908710066462\nAverage time taken for lcss_dist_cy: 0.031031618600536603\nAverage time taken for edr_dist_py: 0.13265878920065005\nAverage time taken for edr_dist_cy: 0.03591040430037538\n```\n\n## Dependencies\n* Python 3\n* Cython\n* Numpy\n* Numba\n\n## References\n[1] https://www.cs.unm.edu/~mueen/DTW.pdf\n\n[2] M. Vlachos, G. Kollios and D. Gunopulos, \"Discovering Similar Multidimensional Trajectories\", 2002.\n\n[3] L Chen, MT Özsu, V Oria, \"Robust and fast similarity search for moving object trajectories\", 2005.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fymtoo%2Fts-dist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fymtoo%2Fts-dist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fymtoo%2Fts-dist/lists"}