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

Function subspace

stumpy/mstump.py:96–242  ·  view source on GitHub ↗

Compute the ``k``-dimensional matrix profile subspace for a given subsequence index and its nearest neighbor index Parameters ---------- T : numpy.ndarray The time series or sequence for which the multi-dimensional matrix profile, multi-dimensional matrix profil

(
    T,
    m,
    subseq_idx,
    nn_idx,
    k,
    include=None,
    discords=False,
    discretize_func=None,
    n_bit=8,
    normalize=True,
    p=2.0,
    T_subseq_isconstant=None,
)

Source from the content-addressed store, hash-verified

94
95@core.non_normalized(maamp_subspace, exclude=["normalize", "T_subseq_isconstant"])
96def subspace(
97 T,
98 m,
99 subseq_idx,
100 nn_idx,
101 k,
102 include=None,
103 discords=False,
104 discretize_func=None,
105 n_bit=8,
106 normalize=True,
107 p=2.0,
108 T_subseq_isconstant=None,
109):
110 """
111 Compute the ``k``-dimensional matrix profile subspace for a given subsequence index
112 and its nearest neighbor index
113
114 Parameters
115 ----------
116 T : numpy.ndarray
117 The time series or sequence for which the multi-dimensional matrix profile,
118 multi-dimensional matrix profile indices were computed.
119
120 m : int
121 Window size.
122
123 subseq_idx : int
124 The subsequence index in ``T``.
125
126 nn_idx : int
127 The nearest neighbor index in ``T``.
128
129 k : int
130 The subset number of dimensions out of ``D = T.shape[0]``-dimensions to return
131 the subspace for. Note that zero-based indexing is used.
132
133 include : numpy.ndarray, default None
134 A list of (zero-based) indices corresponding to the dimensions in ``T`` that
135 must be included in the constrained multidimensional motif search.
136 For more information, see Section IV D in:
137
138 `DOI: 10.1109/ICDM.2017.66 \
139 <https://www.cs.ucr.edu/~eamonn/Motif_Discovery_ICDM.pdf>`__
140
141 discords : bool, default False
142 When set to ``True``, this reverses the distance profile to favor discords
143 rather than motifs. Note that indices in ``include`` are still maintained and
144 respected.
145
146 discretize_func : func, default None
147 A function for discretizing each input array. When this is ``None``, an
148 appropriate discretization function (based on the ``normalize`` parameter) will
149 be applied.
150
151 n_bit : int, default 8
152 The number of bits used for discretization. For more information on an
153 appropriate value, see Figure 4 in:

Callers 5

test_subspaceFunction · 0.90
test_subspace_includeFunction · 0.90
test_subspace_discordsFunction · 0.90
test_subspaceFunction · 0.90

Calls 1

_inverse_normFunction · 0.85

Tested by 5

test_subspaceFunction · 0.72
test_subspace_includeFunction · 0.72
test_subspace_discordsFunction · 0.72
test_subspaceFunction · 0.72