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

Class stimp

stumpy/stimp.py:414–583  ·  view source on GitHub ↗

A class to compute the Pan Matrix Profile This is based on the SKIMP algorithm. Parameters ---------- T : numpy.ndarray The time series or sequence for which to compute the pan matrix profile. min_m : int, default 3 The starting (or minimum) subsequence wi

Source from the content-addressed store, hash-verified

412 replace={"pre_scrump": "pre_scraamp"},
413)
414class stimp(_stimp):
415 """
416 A class to compute the Pan Matrix Profile
417
418 This is based on the SKIMP algorithm.
419
420 Parameters
421 ----------
422 T : numpy.ndarray
423 The time series or sequence for which to compute the pan matrix profile.
424
425 min_m : int, default 3
426 The starting (or minimum) subsequence window size for which a matrix profile
427 may be computed.
428
429 max_m : int, default None
430 The stopping (or maximum) subsequence window size for which a matrix profile
431 may be computed. When ``max_m = None``, this is set to the maximum allowable
432 subsequence window size.
433
434 step : int, default 1
435 The step between subsequence window sizes.
436
437 percentage : float, default 0.01
438 The percentage of the full matrix profile to compute for each subsequence
439 window size. When ``percentage < 1.0``, then the ``scrump`` algorithm is used.
440 Otherwise, the ``stump`` algorithm is used when the exact matrix profile is
441 requested.
442
443 pre_scrump : bool, default True
444 A flag for whether or not to perform the PreSCRIMP calculation prior to
445 computing SCRIMP. If set to ``True``, this is equivalent to computing
446 SCRIMP++. This parameter is ignored when ``percentage = 1.0``.
447
448 normalize : bool, default True
449 When set to ``True``, this z-normalizes subsequences prior to computing
450 distances. Otherwise, this function gets re-routed to its complementary
451 non-normalized equivalent set in the ``@core.non_normalized`` function
452 decorator.
453
454 p : float, default 2.0
455 The p-norm to apply for computing the Minkowski distance. Minkowski distance is
456 typically used with ``p`` being ``1`` or ``2``, which correspond to the
457 Manhattan distance and the Euclidean distance, respectively. This parameter is
458 ignored when ``normalize == True``.
459
460 T_subseq_isconstant_func : function, default None
461 A custom, user-defined function that returns a boolean array that indicates
462 whether a subsequence in ``T`` is constant (``True``). The function must only
463 take two arguments, ``a``, a 1-D array, and ``w``, the window size, while
464 additional arguments may be specified by currying the user-defined function
465 using ``functools.partial``. Any subsequence with at least one
466 ``np.nan``/``np.inf`` will automatically have its corresponding value set to
467 ``False`` in this boolean array.
468
469 Attributes
470 ----------
471 PAN_ : numpy.ndarray

Callers 6

test_stimp_1_percentFunction · 0.90
test_stimp_max_mFunction · 0.90
test_stimp_100_percentFunction · 0.90
test_stimp_raw_mpFunction · 0.90
test_stimpFunction · 0.90

Calls

no outgoing calls

Tested by 6

test_stimp_1_percentFunction · 0.72
test_stimp_max_mFunction · 0.72
test_stimp_100_percentFunction · 0.72
test_stimp_raw_mpFunction · 0.72
test_stimpFunction · 0.72