mirror of
https://github.com/anatolykopyl/DINS-test-assignment.git
synced 2026-03-26 12:55:05 +00:00
initial upload
This commit is contained in:
11
anomaly.py
Normal file
11
anomaly.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
def is_anomaly(result):
|
||||
data = [item["value"] for name in result for item in result[name]]
|
||||
|
||||
x = np.array(data)
|
||||
|
||||
for name in result:
|
||||
for item in result[name]:
|
||||
item["anomaly"] = item["value"] > x.mean() + 3 * x.std()
|
||||
Reference in New Issue
Block a user