File size: 1,627 Bytes
f1e0278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
import streamlit as st
import numpy as np
import pandas as pd
import joblib
from datetime import date
from prophet.plot import plot_plotly, plot_components

##loading my model again

model= joblib.load("models/fbpmodel.joblib")

##loading my test data

test=pd.read_csv("dataframes/test.csv")

test=test.drop(["holiday", "locale", "transferred"], axis= 1)

result= model.predict(test)

##creating my web page

st.set_page_config(page_title="Favorita Stores Sales Prediction App",layout="centered")

#Image loader
st.image("src\screenshots\hour_glass_2.jpg")

##adding my title
st.title("Favorita Store Sales Prediction APP with Facebook Prophet")
    ##adding my description
st.markdown("Welcome to the sales prediction app for Favorita stores!")

df_ori= pd.read_csv("dataframes/original_dataframe.csv")
df_ori= df_ori.set_index("date")
st.subheader("A Chart of the Daily Sales Across Favorita Stores")
st.line_chart(df_ori["sales"])

##defining my inputs
st.header("Make a Forecast Here: ")
ds= st.date_input(label= "Please enter the date you want to forecast")
transactions= st.number_input(label= "Please enter the total number of expected transactions")
onpromotion= st.number_input(label= "Please enter the total number of expected items to be on promotions")

##creating a dataframe for my inputs

input_data= [ds, onpromotion, transactions]
inputs= pd.DataFrame([input_data], columns=["ds", "onpromotion", "transactions"])
forecast= model.predict(inputs)

##creating an output for my output
st.header("Your Prediction is Displayed Below: ")

##telling my model to return the yhat of my input
st.write(forecast["yhat"])