Skip to content

Commit

Permalink
Merge pull request #371 from lscheinkman/issue_370
Browse files Browse the repository at this point in the history
Limit expose anomaly score to values between 0 and 1
  • Loading branch information
lscheinkman authored Jul 30, 2020
2 parents 408b677 + 2ef59b5 commit 2fafea9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nab/detectors/expose/expose_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def handleRecord(self, inputData):
# product, is the likelihood of data point being normal. Resulting
# anomaly scores are in the range of -0.02 to 1.02.
anomalyScore = numpy.asscalar(1 - numpy.inner(inputFeature, exposeModel))
anomalyScore = (anomalyScore + 0.02) / 1.04
self.timestep += 1

return [anomalyScore]

0 comments on commit 2fafea9

Please sign in to comment.