MCPcopy
hub / github.com/stumpy-dev/stumpy / stumpi

Class stumpi

stumpy/stumpi.py:19–553  ·  view source on GitHub ↗

A class to compute an incremental z-normalized matrix profile for streaming data This is based on the on-line STOMPI and STAMPI algorithms. Parameters ---------- T : numpy.ndarray The time series or sequence for which the matrix profile and matrix profile indic

Source from the content-addressed store, hash-verified

17 ],
18)
19class stumpi:
20 """
21 A class to compute an incremental z-normalized matrix profile for streaming data
22
23 This is based on the on-line STOMPI and STAMPI algorithms.
24
25 Parameters
26 ----------
27 T : numpy.ndarray
28 The time series or sequence for which the matrix profile and matrix profile
29 indices will be returned.
30
31 m : int
32 Window size.
33
34 egress : bool, default True
35 If set to ``True``, the oldest data point in the time series is removed and
36 the time series length remains constant rather than forever increasing
37
38 normalize : bool, default True
39 When set to ``True``, this z-normalizes subsequences prior to computing
40 distances. Otherwise, this class gets re-routed to its complementary
41 non-normalized equivalent set in the ``@core.non_normalized`` class decorator.
42
43 p : float, default 2.0
44 The p-norm to apply for computing the Minkowski distance. This parameter is
45 ignored when ``normalize == True``.
46
47 k : int, default 1
48 The number of top ``k`` smallest distances used to construct the matrix profile.
49 Note that this will increase the total computational time and memory usage
50 when ``k > 1``.
51
52 mp : numpy.ndarray, default None
53 A pre-computed matrix profile (and corresponding matrix profile indices).
54 This is a 2D array of shape ``(len(T) - m + 1, 2 * k + 2)``, where the first
55 ``k`` columns are top-k matrix profile, and the next ``k`` columns are their
56 corresponding indices. The last two columns correspond to the top-1 left and
57 top-1 right matrix profile indices. When ``None`` (default), this array is
58 computed internally using ``stumpy.stump``.
59
60 T_subseq_isconstant_func : function, default None
61 A custom, user-defined function that returns a boolean array that indicates
62 whether a subsequence in ``T`` is constant (``True``). The function must only
63 take two arguments, ``a``, a 1-D array, and ``w``, the window size, while
64 additional arguments may be specified by currying the user-defined function
65 using ``functools.partial``. Any subsequence with at least one
66 ``np.nan``/``np.inf`` will automatically have its corresponding value set to
67 ``False`` in this boolean array.
68
69 Attributes
70 ----------
71 P_ : numpy.ndarray
72 The updated (top-k) matrix profile for ``T``. When ``k = 1`` (default), the
73 first (and only) column in this 2D array consists of the matrix profile. When
74 ``k > 1``, the output has exactly ``k`` columns consisting of the top-k matrix
75 profile.
76

Calls

no outgoing calls