File size: 620 Bytes
bd4a798
 
 
 
 
 
f47b1a7
9b2e43d
1a846c2
9b2e43d
 
 
 
 
 
 
 
 
 
a9c59e9
9b2e43d
a9c59e9
9b2e43d
5453322
a9c59e9
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: 
        return "Outlier"
    else:
        return "Not an Outlier"

packet = st.number_input("Packet Number")
st.header(ZRscore_outlier(packet,MED,MA))