def test_subspace(T, m): subseq_idx = 1 nn_idx = 4 for k in range(T.shape[0]): ref_S = stumpy.maamp_subspace(T, m, subseq_idx, nn_idx, k) comp_S = stumpy.subspace(T, m, subseq_idx, nn_idx, k, normalize=False) npt.assert_almost_equal(ref_S, comp_S)
def test_maamp_subspace_discords(T, m): discord_idx = 1 nn_idx = 4 for k in range(T.shape[0]): ref_S = naive.maamp_subspace(T, m, discord_idx, nn_idx, k, discords=True) comp_S = maamp_subspace(T, m, discord_idx, nn_idx, k, discords=True) npt.assert_almost_equal(ref_S, comp_S)
def test_maamp_subspace(T, m): motif_idx = 1 nn_idx = 4 for k in range(T.shape[0]): ref_S = naive.maamp_subspace(T, m, motif_idx, nn_idx, k) comp_S = maamp_subspace(T, m, motif_idx, nn_idx, k) npt.assert_almost_equal(ref_S, comp_S)
def test_maamp_subspace_include(T, m): motif_idx = 1 nn_idx = 4 for width in range(T.shape[0]): for i in range(T.shape[0] - width): include = np.asarray(range(i, i + width + 1)) for k in range(T.shape[0]): ref_S = naive.maamp_subspace(T, m, motif_idx, nn_idx, k, include) comp_S = maamp_subspace(T, m, motif_idx, nn_idx, k, include) npt.assert_almost_equal(ref_S, comp_S)