Crates.io | augurs-dtw |
lib.rs | augurs-dtw |
version | 0.7.0 |
source | src |
created_at | 2024-10-16 08:18:46.956844 |
updated_at | 2024-11-25 08:43:40.087036 |
description | Dynamic Time Warping (DTW) algorithm for Rust |
homepage | |
repository | https://github.com/grafana/augurs |
max_upload_size | |
id | 1411465 |
size | 856,102 |
Implementation of the dynamic time warping (DTW) algorithm.
DTW can be used to compare two sequences that may vary in time or speed.
This implementation has built-in support for both Euclidean and Manhattan distance,
and can be extended to support other distance functions by implementing the [Distance
]
trait and using the [Dtw::new
] constructor.
LB_Kim
(semi-implemented)LB_Keogh
(semi-implemented)Pull requests for missing features would be very welcome.
use augurs::dtw::Dtw;
let a = &[0.0, 1.0, 2.0];
let b = &[3.0, 4.0, 5.0];
let dist = Dtw::euclidean().distance(a, b);
assert_eq!(dist, 5.0990195135927845);
The algorithm is based on the code from the UCR Suite. Benchmarks show similar
or faster timings compared to dtaidistance
's C implementation, but note that dtaidistance
is much more
full featured!
Dual-licensed to be compatible with the Rust project.
Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>
or the MIT license <http://opensource.org/licenses/MIT>
, at your option.