wildboar.annotate._motifs#

Module Contents#

Functions#

motifs(x[, mp, window, exclude, max_distance, ...])

Find motifs

wildboar.annotate._motifs.motifs(x, mp=None, *, window='auto', exclude=0.2, max_distance='best', max_neighbours=10, min_neighbours=1, max_motif=1, return_distance=False)[source]#

Find motifs

Parameters:
  • x (array-like of shape (n_samples, n_timestep)) – The time series

  • mp (ndarray or shape (n_samples, profile_size), optional) – The matrix profile. The matrix profile is computed if None.

  • window ("auto", int or float, optional) –

    The window size of the matrix profile.

    • if “auto” the window is math.ceil(0.1 * n_timesteps) if mp=None, and the window of the matrix profile if mp is not None.

    • if float, a fraction of n_timestep

    • if int, the exact window size

  • exclude (float, optional) – The size of the exclusion zone.

  • max_distance (str, optional) – The maximum distance between motifs.

  • max_matches (int, optional) – The maximum number of neighbours

  • min_neighbours (int, optional) – The minimum number of neighbours

  • max_motif (int, optional) – The maximum number of motifs to return.

  • return_distance (bool, optional) – Return the distance from main to neighbours

Returns:

  • motif_indicies (list) – List of arrays of motif neighbour indicies

  • motif_distance (list, optional) – List of arrays of distance from motif to neighbours

See also

wildboar.distance.subsequence_match

find subsequence matches

wildboar.distance.matrix_profile

compute the matrix profile

References

Yeh, C. C. M. et al. (2016).

Matrix profile I: All pairs similarity joins for time series: a unifying view that includes motifs, discords and shapelets. In 2016 IEEE 16th international conference on data mining (ICDM)