File size: 580 Bytes
bd4a798
 
 
 
 
 
f47b1a7
9b2e43d
1a846c2
9b2e43d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st 
import numpy as np 
import pandas as pd 
import pickle 
from PIL import Image 

image = Image.open('picture.png')
st.image(image,caption = 'Network Data Anomaly',width =1000)

st.title("Network Data Anomaly")

with open("./median.pickle", 'rb') as f:
    MED = pickle.load(f)
with open("./mad.pickle", 'rb') as g:
    MA = pickle.load(g)

def ZRscore_outlier(packet,med,ma):
    z = (0.6745*(packet-med))/ (np.median(ma))
    if np.abs(z) > 3: 
        print("Outlier")
    else:
        print("Not an Outlier")

packet = 373
ZRscore_outlier(packet,MED,MA)