SigmaScorer | R Documentation |
R6 class that allows computing the anomaly score online based on historic prediction errors and 3-sigma control limits.
new()
Create a new SigmaScorer object.
SigmaScorer$new(wnMin = 100, wnMax = 2000, l = 3, computeLogLikelihood = F)
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.
A new SigmaScorer object.
computeScore()
Calculates the anomaly score from the prediction error.
SigmaScorer$computeScore(x, ...)
x
Current error value to be scored.
...
Any other parameter.
Anomaly score, a value between [0,1]. The closer the number is to 1, the higher the chance it is an anomaly.
scorer <- SigmaScorer$new(3, 4) scorer$computeScore(0.5) scorer$computeScore(0.6) scorer$computeScore(0.5) scorer$computeScore(1) scorer$computeScore(0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.