How to use the stumpy.core.z_norm function in stumpy

To help you get started, we’ve selected a few stumpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TDAmeritrade / stumpy / tests / test_mstump.py View on Github external
def naive_mass(Q, T, m, trivial_idx, excl_zone):
    D = np.linalg.norm(
        core.z_norm(core.rolling_window(T, m), 1) - core.z_norm(Q), axis=1
    )
    start = max(0, trivial_idx - excl_zone)
    stop = min(T.shape[0] - Q.shape[0] + 1, trivial_idx + excl_zone)
    D[start:stop] = np.inf

    return D
github TDAmeritrade / stumpy / tests / test_core.py View on Github external
def test_mueen_calculate_distance_profile(Q, T):
    m = Q.shape[0]
    left = np.linalg.norm(
        core.z_norm(core.rolling_window(T, m), 1) - core.z_norm(Q), axis=1
    )
    right = core.mueen_calculate_distance_profile(Q, T)
    npt.assert_almost_equal(left, right)