Crates.io | curve_similarities |
lib.rs | curve_similarities |
version | 0.1.0 |
source | src |
created_at | 2024-08-24 09:38:57.115392 |
updated_at | 2024-08-24 09:38:57.115392 |
description | Calculation of curve similarities for 2-dimensional arrays |
homepage | |
repository | |
max_upload_size | |
id | 1350147 |
size | 11,178 |
Implementation of calculations for curves similarities as in python package similarity_measures.
At the moment has implementations for Frechet and DTW distances, allowing for both Euclidean and Manhattan pointwise distances.
The library requires in input a bidimensional array of the ndarray rust library.
use curve_similarities::{frechet, DistMetric};
use ndarray::array;
fn main() {
let fr = frechet(
&array![[1.0], [1.0], [3.0]],
&array![[2.0], [4.0]],
DistMetric::Euclidean
);
println!("Frechet distance between curves is {}", fr);
}
Currently still using ndarray
version 0.15.0
in order to use ndarray-stats
for pointwise distance.
[dependencies]
approx = "0.3.2"
ndarray = "0.15.0"
ndarray-stats = "0.5.1"
num = "0.4.3"