File size: 1,238 Bytes
a7b127f
 
 
 
 
 
 
 
 
 
5d75077
 
 
 
 
d197604
a7b127f
 
 
 
 
 
 
 
 
066b8cd
 
 
 
9c9a930
066b8cd
2bfce2d
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import numpy as np
import pickle
import warnings
import streamlit as st

warnings.simplefilter("ignore", UserWarning)

MODEL = pickle.load(open('IF_model_anomaly.pkl','rb'))

st.title("Retail Anomaly")
st.write(""" Anomaly detection (or outlier detection) is the identification of rare items, events or observations which raise suspicions by
differing significantly from the majority of the data. Typically, anomalous data can be connected to some kind of problem or rare event such
as e.g. bank fraud, medical problems, structural defects, malfunctioning equipment etc. This connection makes it very interesting to be able 
to pick out which data points can be considered anomalies, as identifying these events are typically very interesting from a business perspective.
""")

def prediction(sales,model):
    sales = np.float64(sales)
    pred = model.predict(sales.reshape(-1,1))[0]
    if pred == -1:
        return "Outlier"
    else:
        return "Not outlier"

sales = st.number_input("Enter the Sales Value")
def fun():
    st.header(prediction(sales,MODEL))
if st.button("Predict"):
    fun()


st.write("""







For detail description visit https://huggingface.co/spaces/ThirdEyeData/Retail-Anomaly/blob/main/README.md

""")