mirror of
https://github.com/anatolykopyl/DINS-test-assignment.git
synced 2026-03-26 12:55:05 +00:00
replaced a dictionary with a list to increace performance
This commit is contained in:
@@ -2,10 +2,10 @@ import numpy as np
|
||||
|
||||
|
||||
def is_anomaly(result):
|
||||
data = [item["value"] for name in result for item in result[name]]
|
||||
data = [item[1] 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()
|
||||
item[2] = item[1] > x.mean() + 3 * x.std()
|
||||
Reference in New Issue
Block a user