-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Python extension backed by a multi-threaded Rust implementation of Dynamic Time Warping (DTW).
To install rustDTW, simply:
pip install rust-dtwIn time series analysis, dynamic time warping (DTW) is one of the algorithms for measuring similarity between two temporal sequences, which may vary in speed 1. This has applications in speech recognition, time series classification and neuroscience.
Core dynamic time warping routine. Computes the distance between 2 float64 numpy arrays that represent time series data Example Usage:
result = rust_dtw.dtw(
s=np.array([0., 1., 2.]),
t=np.array([3., 4., 5.]),
window=50,
distance_mode="euclidean"
)- Window represents the warping window size.
- Distance mode is the distance metric used between points (euclidean | manhattan)
Computes the distance between each timeseries, with the timeseries data represented as a 2d numpy matrix. For fMRI data, we would expect an (m x n) matrix where ( number of time points x number of ROIs).
Example Usage:
result = rust_dtw.dtw_connectome(
connectome=timeseries,
window=100,
distance_mode="euclidean"
)Computes the DTW connectomes for an entire cohort of subjects. Float64 numpy matrix provided, where (m x n x k) is ( n_subjects x n_samples x n_features).
Example Usage:
result = rust_dtw.dtw_connectomes(
connectomes=timeseries,
window=100,
vectorize=False,
distance_mode="euclidean"
)