Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,21 @@ import pickle
|
|
5 |
from PIL import Image
|
6 |
|
7 |
image = Image.open('picture.png')
|
8 |
-
st.image(image,caption = 'Network Data Anomaly',width =1000
|
9 |
|
10 |
-
st.title("Network Data Anomaly")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
from PIL import Image
|
6 |
|
7 |
image = Image.open('picture.png')
|
8 |
+
st.image(image,caption = 'Network Data Anomaly',width =1000)
|
9 |
|
10 |
+
st.title("Network Data Anomaly")
|
11 |
+
|
12 |
+
with open("./median.pickle", 'rb') as f:
|
13 |
+
MED = pickle.load(f)
|
14 |
+
with open("./mad.pickle", 'rb') as g:
|
15 |
+
MA = pickle.load(g)
|
16 |
+
|
17 |
+
def ZRscore_outlier(packet,med,ma):
|
18 |
+
z = (0.6745*(packet-med))/ (np.median(ma))
|
19 |
+
if np.abs(z) > 3:
|
20 |
+
print("Outlier")
|
21 |
+
else:
|
22 |
+
print("Not an Outlier")
|
23 |
+
|
24 |
+
packet = 373
|
25 |
+
ZRscore_outlier(packet,MED,MA)
|