sktime.distances.mpdist

sktime.distances.mpdist.calculate_distance_profile(dot_prod, q_mean, q_std, t_mean, t_std, q_len, n_t_subs)[source]

Calculates the distance profile for the given query.

Parameters
  • dot_prod (numpy.array) – Sliding dot products between the time series and the query.

  • q_mean (float) – Mean of the elements of the query.

  • q_std (float) – Standard deviation of elements of the query.

  • t_mean (numpy.array) – Array with the mean of the elements from each subsequence of length(query) from the time series.

  • t_std (numpy.array) – Array with the standard deviation of the elements from each subsequence of length(query) from the time series.

  • q_len (int) – Length of the query.

  • n_t_subs (int) – Number of subsequences in the time series.

d: numpy.array

Distance profile of query q.

sktime.distances.mpdist.mpdist(ts1, ts2, m=0)[source]

MPDist implementation.

Parameters
  • ts1 (numpy.array) – First time series.

  • ts2 (numpy.array) – Second time series.

  • m (int) – Length of the subsequences.

mpdist: float

Distance between the two time series.

sktime.distances.mpdist.sliding_dot_products(q, t, q_len, t_len)[source]

Computes the sliding dot products between a query and a time series.

Parameters
  • q (numpy.array) – Query.

  • t (numpy.array) – Time series.

  • q_len (int) – Length of the query.

  • t_len (int) – Length of the time series.

dot_prod: numpy.array

Sliding dot products between q and t.

sktime.distances.mpdist.stomp_ab(ts1, ts2, m)[source]

STOMP implementation for AB similarity join.

Parameters
  • ts1 (numpy.array) – First time series.

  • ts2 (numpy.array) – Second time series.

  • m (int) – Length of the subsequences.

mp: numpy.array

Array with the distance between every subsequence from ts1 to the nearest subsequence with same length from ts2.

ip: numpy.array

Array with the index of the nearest neighbor of ts1 in ts2.