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

Function stumped

stumpy/stumped.py:395–662  ·  view source on GitHub ↗

Compute the z-normalized matrix profile with a ``dask``/``ray`` cluster This is a highly distributed implementation around the Numba JIT-compiled parallelized ``_stump`` function which computes the (top-k) matrix profile according to STOMPopt with Pearson correlations. Paramet

(
    client,
    T_A,
    m,
    T_B=None,
    ignore_trivial=True,
    normalize=True,
    p=2.0,
    k=1,
    T_A_subseq_isconstant=None,
    T_B_subseq_isconstant=None,
)

Source from the content-addressed store, hash-verified

393
394@core.non_normalized(aamped)
395def stumped(
396 client,
397 T_A,
398 m,
399 T_B=None,
400 ignore_trivial=True,
401 normalize=True,
402 p=2.0,
403 k=1,
404 T_A_subseq_isconstant=None,
405 T_B_subseq_isconstant=None,
406):
407 """
408 Compute the z-normalized matrix profile with a ``dask``/``ray`` cluster
409
410 This is a highly distributed implementation around the Numba JIT-compiled
411 parallelized ``_stump`` function which computes the (top-k) matrix profile
412 according to STOMPopt with Pearson correlations.
413
414 Parameters
415 ----------
416 client : client
417 A ``dask``/``ray`` client. Setting up a cluster is beyond the scope of this
418 library. Please refer to the ``dask``/``ray`` documentation.
419
420 T_A : numpy.ndarray
421 The time series or sequence for which to compute the matrix profile.
422
423 m : int
424 Window size.
425
426 T_B : numpy.ndarray, default None
427 The time series or sequence that will be used to annotate ``T_A``. For every
428 subsequence in ``T_A``, its nearest neighbor in ``T_B`` will be recorded.
429 Default is ``None`` which corresponds to a self-join.
430
431 ignore_trivial : bool, default True
432 Set to ``True`` if this is a self-join (i.e., for a single time series
433 ``T_A`` without ``T_B``). This ensures that an exclusion zone is applied
434 to each subsequence in ``T_A`` and all trivial/self-matches are ignored.
435 Otherwise, for an AB-join (i.e., between two times series, ``T_A`` and
436 ``T_B``), set this to ``False``.
437
438 normalize : bool, default True
439 When set to ``True``, this z-normalizes subsequences prior to computing
440 distances. Otherwise, this function gets re-routed to its complementary
441 non-normalized equivalent set in the ``@core.non_normalized`` function
442 decorator.
443
444 p : float, default 2.0
445 The p-norm to apply for computing the Minkowski distance. Minkowski distance is
446 typically used with ``p`` being ``1`` or ``2``, which correspond to the
447 Manhattan distance and the Euclidean distance, respectively. This parameter is
448 ignored when ``normalize == True``.
449
450 k : int, default 1
451 The number of top ``k`` smallest distances used to construct the matrix
452 profile. Note that this will increase the total computational time and memory

Calls 1

mparrayClass · 0.90