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

Method update

stumpy/scrump.py:1026–1075  ·  view source on GitHub ↗

Update the (top-k) matrix profile and the (top-k) matrix profile indices by computing additional new distances (limited by `percentage`) that make up the full distance matrix. Parameters ---------- None Returns ------- None

(self)

Source from the content-addressed store, hash-verified

1024 self._chunk_idx = 0
1025
1026 def update(self):
1027 """
1028 Update the (top-k) matrix profile and the (top-k) matrix profile indices by
1029 computing additional new distances (limited by `percentage`) that make up
1030 the full distance matrix.
1031
1032 Parameters
1033 ----------
1034 None
1035
1036 Returns
1037 -------
1038 None
1039 """
1040 if self._chunk_idx < self._n_chunks:
1041 start_idx, stop_idx = self._chunk_diags_ranges[self._chunk_idx]
1042
1043 P, PL, PR, I, IL, IR = _stump(
1044 self._T_A,
1045 self._T_B,
1046 self._m,
1047 self._μ_Q,
1048 self._M_T,
1049 self._σ_Q_inverse,
1050 self._Σ_T_inverse,
1051 self._μ_Q_m_1,
1052 self._M_T_m_1,
1053 self._Q_subseq_isfinite,
1054 self._T_subseq_isfinite,
1055 self._Q_subseq_isconstant,
1056 self._T_subseq_isconstant,
1057 self._diags[start_idx:stop_idx],
1058 self._ignore_trivial,
1059 self._k,
1060 )
1061
1062 # Update (top-k) matrix profile and indices
1063 core._merge_topk_PI(self._P, P, self._I, I)
1064
1065 # update left matrix profile and indices
1066 mask = PL < self._PL
1067 self._PL[mask] = PL[mask]
1068 self._IL[mask] = IL[mask]
1069
1070 # update right matrix profile and indices
1071 mask = PR < self._PR
1072 self._PR[mask] = PR[mask]
1073 self._IR[mask] = IR[mask]
1074
1075 self._chunk_idx += 1
1076
1077 @property
1078 def P_(self):

Callers

nothing calls this directly

Calls 1

_stumpFunction · 0.85

Tested by

no test coverage detected