Skip to content

Ts_subseq_isconstant parameter in ostinato algorithm #947

Closed

Description

@ogreyesp

Hello

I´m working with the stumpy.ostinato algorithm to find consensus motifs. I'm creating a method wherein some subsequences of the timeseries provided to ostinato should not be taken into account. Is that the purpose of Ts_subseq_isconstant parameter?

I´m trying to read the code of the ostinato implementation, but I cannot completely understand what is the purpose of Ts_subseq_isconstant parameter, and also an example using this parameter is not given. Could you help me?

Activity

  1. seanlaw commented on Jan 25, 2024

    @seanlaw
    Contributor

    @ogreyesp Thank you for your question and welcome to the STUMPY community.

    I'm creating a method wherein some subsequences of the timeseries provided to ostinato should not be taken into account.

    If you truly do not care about a subsequence then you have two main options:

    1. You can remove those subsequences from your original time series.
    2. You can manually set the values of those subsequences to np.nan. In STUMPY, any subsequence that contains np.nan/np.inf will have their corresponding distances set to np.nan.

    Is that the purpose of Ts_subseq_isconstant parameter?

    No, the subseq_isconstant parameter found throughout STUMPY are a way for the user to annotate each subsequences within a time series as "constant" (i.e., are all of the values within the subsequence the same) or not. Due to numerical imprecision, simply checking if the standard deviation within each subsequence is equal to zero is insufficient in some rare cases and so we've provided this parameter to allow for more user control.

  2. ogreyesp commented on Jan 26, 2024

    @ogreyesp
    Author

    @seanlaw Thank you very much.

    Now, it is clearer for me. So, in my case, the second option you mentioned (the use of np.nan) is the most suitable.

    Best regards

    Óscar

  3. locked and limited conversation to collaborators on Jan 26, 2024
  4. converted this issue into a discussion #949 on Jan 26, 2024
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions