Code Monkey home page Code Monkey logo

Comments (1)

shaido987 avatar shaido987 commented on May 26, 2024

Hello,

Thank you for your question and sorry for the late reply.

Since we are generating data with synthetic anomalies, before running scale_anomaly both the predict and real values are exactly the same.
scale_anomaly moves the values of either the real or the predict column by reducing them by a factor r.
r is obtained from the anomaly specific (there can be multiple anomalies) sampled severity and deviation of the anomaly, following a normal distribution.

r = rng.normal(loc=severity, scale=deviation)
v = max(row * (1 - r), 0.0)

In this work (as with Squeeze), we only consider KPIs that are additive (or derived KPIs based on additive KPIs). Relevant examples are page views, error counts, traffic volume, etc. These are all strictly positive and can not have negative values.
The max(row * (1 - r), 0.0) is thus to make sure that the real value and the predict value (again, depending on the anomaly direction) are positive.

So for your question: that the predicted value then becomes 0 is a consequence of the severity of the anomaly being large, getting an r>=1.
Imagine for example that the KPI counts error codes and is usually normal (e.g., predict=0). When the actual values are above that we still want to be able to determine the root cause which will fail if elements with predict 0 are removed.

However, running Squeeze, any rows with predict=0 and non-zero actual value will receive a deviation score of -2 and should not automatically be filtered away.

from riskloc.

Related Issues (9)

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.