Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The windowChecking option allows the operator, to use a window and check, if there is at least one anomaly in that window. If the data stream has anomal phases where some tuple may are "normal", these "normal" tuples can be marked as anomalies if they are between two windows which have both at least one anomaly. The figure below explains that behavior. The squares are tuples, each tuple is in exactly one window (a tumbling window is used). The tuples with a 0 are normal tuples, the tuples with a 10 are anomal tuples. With the option "windowChecking = true" the tuples between those two anomalies are also marked as anomalies and are therefore in the output stream.

Example

The code belows shows an example with the windowChecking option. Here, some more special settings are used. The operator won't report the anomalies between the first and the last anomaly in an anomaly sequence. If you again take a look at the example figure above, the zeros between the "10"-tuples would not be reported with this options.

Code Block
linenumberstrue
#PARSER PQL
#RUNQUERY
/// A tumbling window -> We will search for anomalies in a window
windowOp = ELEMENTWINDOW({
                size = 20,
                advance = 20                            
              },
              System.fridgeVibration
            )
            
/// Learn how the "normal" area looks like
intervalLearn = DEVIATIONLEARN({
                    nameofparameter = 'vibration',
                    trainingmode = 'TUPLE_BASED',
                    tuplestolearn = 100                  
                  },
                  windowOp
                )

/// Checks, if the current window has an anomaly
intervalDetect = DEVIATIONANOMALYDETECTION({
                      nameofparameter = 'vibration',
                      interval = 3.0,
                      windowchecking = 'true',
                      onlyfirstanomaly = 'true',
                      reportendofanomalies = 'true'                             
                    },
                    1:intervalLearn,
                    0:intervalLearn
                  )