SigmaScorer: Sigma scorer

SigmaScorerR Documentation

Sigma scorer

Description

R6 class that allows computing the anomaly score online based on historic prediction errors and 3-sigma control limits.

Methods

Public methods


Method new()

Create a new SigmaScorer object.

Usage
SigmaScorer$new(wnMin = 100, wnMax = 2000, l = 3, computeLogLikelihood = F)
Arguments
wnMin

Minimum window size to start computing the anomaly score. It must be an integer between [1, wnMax].

wnMax

Maximum window size to compute the anomaly score. It must be an integer equal or bigger than wnMin.

l

Number of deviations from the mean. It must be an integer greater than 0. By default 3, but another common value is 6.

computeLogLikelihood

If TRUE compute a log scale representation of the likelihood value. Since thelikelihood computations return low probabilities that often go into four 9's or five 9's, a log value is more useful for visualization, thresholding, etc.

Returns

A new SigmaScorer object.


Method computeScore()

Calculates the anomaly score from the prediction error.

Usage
SigmaScorer$computeScore(x, ...)
Arguments
x

Current error value to be scored.

...

Any other parameter.

Returns

Anomaly score, a value between [0,1]. The closer the number is to 1, the higher the chance it is an anomaly.

Examples


scorer <- SigmaScorer$new(3, 4)

scorer$computeScore(0.5)
scorer$computeScore(0.6)
scorer$computeScore(0.5)
scorer$computeScore(1)
scorer$computeScore(0.2)


alaineiturria/otsad documentation built on Jan. 12, 2023, 12:26 p.m.