Retail-Anomaly / app.py
saritha5's picture
Update app.py
066b8cd
raw
history blame
529 Bytes
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")
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()