MCPcopy Index your code
hub / github.com/stumpy-dev/stumpy / multi_distance_profile

Function multi_distance_profile

stumpy/mstump.py:557–655  ·  view source on GitHub ↗

Multi-dimensional wrapper to compute the multi-dimensional distance profile for a given query window within the times series or sequence that is denoted by the `query_idx` index. Parameters ---------- query_idx : int The window index to calculate the multi-dimension

(
    query_idx,
    T,
    m,
    include=None,
    discords=False,
    normalize=True,
    p=2.0,
    T_subseq_isconstant=None,
)

Source from the content-addressed store, hash-verified

555 maamp_multi_distance_profile, exclude=["normalize", "T_subseq_isconstant"]
556)
557def multi_distance_profile(
558 query_idx,
559 T,
560 m,
561 include=None,
562 discords=False,
563 normalize=True,
564 p=2.0,
565 T_subseq_isconstant=None,
566):
567 """
568 Multi-dimensional wrapper to compute the multi-dimensional distance profile for a
569 given query window within the times series or sequence that is denoted by the
570 `query_idx` index.
571
572 Parameters
573 ----------
574 query_idx : int
575 The window index to calculate the multi-dimensional distance profile for
576
577 T : numpy.ndarray
578 The multi-dimensional time series or sequence for which the multi-dimensional
579 distance profile will be returned
580
581 m : int
582 Window size
583
584 include : numpy.ndarray, default None
585 A list of (zero-based) indices corresponding to the dimensions in `T` that
586 must be included in the constrained multidimensional motif search.
587 For more information, see Section IV D in:
588
589 `DOI: 10.1109/ICDM.2017.66 \
590 <https://www.cs.ucr.edu/~eamonn/Motif_Discovery_ICDM.pdf>`__
591
592 discords : bool, default False
593 When set to `True`, this reverses the distance profile to favor discords rather
594 than motifs. Note that indices in `include` are still maintained and respected.
595
596 normalize : bool, default True
597 When set to `True`, this z-normalizes subsequences prior to computing distances.
598 Otherwise, this function gets re-routed to its complementary non-normalized
599 equivalent set in the `@core.non_normalized` function decorator.
600
601 p : float, default 2.0
602 The p-norm to apply for computing the Minkowski distance. Minkowski distance is
603 typically used with `p` being 1 or 2, which correspond to the Manhattan distance
604 and the Euclidean distance, respectively. This parameter is ignored when
605 `normalize == True`.
606
607 T_subseq_isconstant : numpy.ndarray, function, or list, default None
608 A parameter that is used to show whether a subsequence of a time series in `T`
609 is constant (True) or not. T_subseq_isconstant can be a 2D boolean numpy.ndarray
610 or a function that can be applied to each time series in `T`. Alternatively, for
611 maximum flexibility, a list (with length equal to the total number of time
612 series) may also be used. In this case, T_subseq_isconstant[i] corresponds to
613 the i-th time series T[i] and each element in the list can either be a 1D
614 boolean ``numpy.ndarray``, a function, or None.

Calls 1

_multi_distance_profileFunction · 0.85