Skip to content

Add parameter T_subseq_isfinite to stumpy.motifs #521

Closed

Description

@NimaSarajpoor

I was wondering if we could add T_subseq_isfinite to the stumpy.motifs. It can then be used in the following block of code in function _motifs:

query_matches = match(
            Q,
            T,
            M_T=M_T,
            Σ_T=Σ_T,
            max_matches=None,
            max_distance=max_distance,
            atol=atol,
        )

Activity

  1. seanlaw commented on Jan 19, 2022

    @seanlaw
    Contributor

    @ninimama I'm not sure what you mean? z-normalized functions like stumpy.motifs don't use T_subseq_isfinite anywhere. Only non-normalized methods use T_subseq_isfinite. What you please explain what you are you trying to accomplish?

  2. NimaSarajpoor commented on Jan 19, 2022

    @NimaSarajpoor
    CollaboratorAuthor

    z-normalized functions like stumpy.motifs don't use T_subseq_isfinite anywhere. Only non-normalized methods use T_subseq_isfinite

    Didn't know that. My case is for non-normalized distance though. I was trying to find each motif (and their matches) and then exclude them and their trivial matches, and then iterate through the process (i.e. finding the next motif) till I cover the whole time series.

    I know that the function _aamp_motifs has a similar concept:

    for idx in query_matches[:, 1]:
                core.apply_exclusion_zone(P, int(idx), excl_zone, np.inf)
    
    

    However, if I understand correctly, we here apply exclusion on the matrix profile. What I am looking for is something different. I want to apply it on distance profile for query matching, which can be done by T_subseq_isfinite. I might make a branch and experience it later. I understand it might not be good to have one-for-all purpose function. So, feel free to close this if you think it is better to keep the function as is.

  3. seanlaw commented on Jan 19, 2022

    @seanlaw
    Contributor

    If you are dealing with query matching, have you looked at the stumpy.match function? It's a bit hard for me to understand what it is that you want to accomplish without more information.

  4. NimaSarajpoor commented on Jan 19, 2022

    @NimaSarajpoor
    CollaboratorAuthor

    Please let me know if this explanation helps.

    This is what I am trying to achieve: Given a time series T (and there is no query Q), I want to get the very-top motif and their top-k matches. Then, I want to get the next motif. However, I want to completely ignore the previously-discovered motif (i.e. I do not want it to affect the matrix profile P in the first place. In other words, I want to set their corresponding indices to np.inf in distance profile). This way, I can make sure that after some iterations, my motifs (and their matches) will exhaust the whole time series T. I acknowledge that as I go through the iterations based on the aforementioned approach, my later motifs might get a very large distance to their NN, which is from the remaining indices. But, I am okay with that.


    This can be seen as some sort of clustering. The general idea is to group the top-motif with its k_NN matches; and then go through the rest of subsequences. (I know that we are not optimizing any objective function here and I know there are some overlaps between subsequences; but I just want to see IF I FORCE my time series T to be broken down to some similar subsequence, how would it look like?)

  5. NimaSarajpoor commented on Jan 19, 2022

    @NimaSarajpoor
    CollaboratorAuthor

    @seanlaw
    Is that okay if you move it to discussion for now?

  6. locked and limited conversation to collaborators on Jan 19, 2022
  7. converted this issue into a discussion #524 on Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions