A class to ompute an approximate z-normalized matrix profile This is a convenience wrapper around the Numba JIT-compiled parallelized ``_stump`` function which computes the matrix profile according to SCRIMP. Parameters ---------- T_A : numpy.ndarray The time serie
| 648 | replace={"pre_scrump": "pre_scraamp"}, |
| 649 | ) |
| 650 | class scrump: |
| 651 | """ |
| 652 | A class to ompute an approximate z-normalized matrix profile |
| 653 | |
| 654 | This is a convenience wrapper around the Numba JIT-compiled parallelized |
| 655 | ``_stump`` function which computes the matrix profile according to SCRIMP. |
| 656 | |
| 657 | Parameters |
| 658 | ---------- |
| 659 | T_A : numpy.ndarray |
| 660 | The time series or sequence for which to compute the matrix profile. |
| 661 | |
| 662 | T_B : numpy.ndarray |
| 663 | The time series or sequence that will be used to annotate ``T_A``. For every |
| 664 | subsequence in ``T_A``, its nearest neighbor in ``T_B`` will be recorded. |
| 665 | |
| 666 | m : int |
| 667 | Window size. |
| 668 | |
| 669 | ignore_trivial : bool |
| 670 | Set to ``True`` if this is a self-join. Otherwise, for AB-join, set this to |
| 671 | ``False``. |
| 672 | |
| 673 | percentage : float |
| 674 | Approximate percentage completed. The value is between ``0.0`` and ``1.0``. |
| 675 | |
| 676 | pre_scrump : bool |
| 677 | A flag for whether or not to perform the PreSCRIMP calculation prior to |
| 678 | computing SCRIMP. If set to ``True``, this is equivalent to computing |
| 679 | SCRIMP++ and may lead to faster convergence |
| 680 | |
| 681 | s : int |
| 682 | The size of the PreSCRIMP fixed interval. If ``pre_scrump = True`` and |
| 683 | ``s = None``, then ``s`` will automatically be set to |
| 684 | ``s = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))``, which is the size of |
| 685 | the exclusion zone. |
| 686 | |
| 687 | normalize : bool, default True |
| 688 | When set to ``True``, this z-normalizes subsequences prior to computing |
| 689 | distances. Otherwise, this class gets re-routed to its complementary |
| 690 | non-normalized equivalent set in the ``@core.non_normalized`` class decorator. |
| 691 | |
| 692 | p : float, default 2.0 |
| 693 | The p-norm to apply for computing the Minkowski distance. Minkowski distance is |
| 694 | typically used with ``p`` being ``1`` or ``2``, which correspond to the |
| 695 | Manhattan distance and the Euclidean distance, respectively. This parameter is |
| 696 | ignored when ``normalize == True``. |
| 697 | |
| 698 | k : int, default 1 |
| 699 | The number of top ``k`` smallest distances used to construct the matrix profile. |
| 700 | Note that this will increase the total computational time and memory usage |
| 701 | when ``k > 1``. |
| 702 | |
| 703 | T_A_subseq_isconstant : numpy.ndarray or function, default None |
| 704 | A boolean array that indicates whether a subsequence in ``T_A`` is constant |
| 705 | (``True``). Alternatively, a custom, user-defined function that returns a |
| 706 | boolean array that indicates whether a subsequence in ``T_A`` is constant |
| 707 | (``True``). The function must only take two arguments, ``a``, a 1-D array, |
no outgoing calls