Giter VIP home page Giter VIP logo

Comments (2)

pembeci avatar pembeci commented on May 20, 2024 1

Thanks for the detailed explanation Sean. I didn't have the time to look deeper in paper's math or code. As a user, I think both options (warning or ValueError) are fine as long as I am given notice of this limitation. From software engineering angle, ValueError may be a better option though. If this wasn't faced during exploratary/development phase, warning may get lost in a complex program utilizing STUMPY where m is computed dynamically. Feel free to close the issue whenever you like.

from stumpy.

seanlaw avatar seanlaw commented on May 20, 2024

@pembeci Thanks for pointing this out and I can confirm this finding.

It looks like the issue comes up when the z-normalization happens. In the case of m=1, z-normalization doesn't make any sense since the standard deviation for an array with only a single element will always be zero and, therefore, you get a divide by zero situation. So, m should never be equal to 1.

In the case of m=2, the mean and standard deviation for any given subsequence are identical and so the z-normalization for any sequence will either be [-1., 1.] or [1., -1.]. Thus, the z-normalized Euclidean distance will be (very likely) zero between any subsequence and its nearest neighbor (assuming that the time series is large enough to contain both scenarios).

In short, this isn't so much a fault of STUMPY but of the ambiguity of what z-normalization means for toy examples where m <= 2. Values of m <= 2 must be avoided. The situation is fine when the m >= 3 or when m and the length of the array gets bigger and bigger.

As a user, would you mind providing some feedback as to how you might expect these scenarios to be handled?

In the simplest case, we can add a check and always enforce that m >= 3 and print a logging warning to let the user know that the value of m must be greater than or equal to 3. On second thought, it probably makes more sense to raise a ValueError. I'd love to hear your thoughts.

from stumpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.