extendedMD.dtwdist

extendedMD.dtwdist.add_distance_vec_to_pattern_dic(pattern_dic_list, r=None)

This function returns a new pattern_dic_list where each dic has an extra entry with the vector of distances between the BS sequence related to that dic and all the other BS subsequences in the pattern

Parameters:
  • pattern_dic_list (list of dic) – list of all the dictionaries related to BS sequences in the pattern
  • r (float) – distance upper bound (for DTW distance computation)
Returns:

new_pattern_dic_list

Return type:

list of dic

extendedMD.dtwdist.compute_dtw_dist_mat(ts_list, r=None)

This function computes the pairwise distance matrix of a list of time-series with Dynamic Time Warping distance. It is based on dtaidistance package

Parameters:
  • ts_list (list of 1D array) – list of time-series to compare pairwise
  • r (float) – distance upper bound - if distance is higher than R, then computation stops and the distance is set as inf this parameter serves merely for speeding up computation
Returns:

distance matrix

Return type:

2D array

extendedMD.dtwdist.compute_dwt_dist_between_ts_and_list(single_ts, ts_list, r)

This function computes the list of DTW distances between a single time-series and a list of time-series.

Parameters:
  • single_ts (1d array) – single time-series
  • ts_list (list of 1d array) – list of time-series
  • r (float) – distance upper bound (for DTW distance computation)
Returns:

list of DTW distances

Return type:

list of float