Spaces:
Runtime error
Runtime error
File size: 946 Bytes
9ac3b25 1068f7e 9ac3b25 fd7f355 9ac3b25 |
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 |
import streamlit as st
from datetime import date
import numpy as np
import pandas as pd
import joblib
# web page
# tittle
st.title('Favorita Store Sales Prediction APP with Facebook Prophet')
st.markdown('this predict sales')
# data loading
best_model= joblib.load('saved_ml.joblib')
# inputs
st.header('make a forecast here:')
ds= st.date_input(label='Please enter your forecast date')
transactions= st.number_input(label='Please enter your total expected number of transactions')
onpromotion= st.number_input(label='Please enter total number of items on promotion')
# input dataframe
ok= st.button('forecast sales')
if ok:
input_data= [ds,onpromotion,transactions]
inputs= pd.DataFrame([input_data],columns=['ds','onpromotion','transactions'])
# making Prediction
forecast=best_model.predict(inputs)
output_values=forecast['yhat']
st.success (f'the estimated forecast sales ${output_values.values[0]:.2f}')
|