Retail-Anomaly / app.py
saritha5's picture
Update app.py
2bfce2d
raw
history blame
1.29 kB
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()
a_link = st.multiselect("choose a link", [,url_b])
st.write("""
For detail description visit https://huggingface.co/spaces/ThirdEyeData/Retail-Anomaly/blob/main/README.md
""")