Spaces:
Runtime error
Runtime error
Update pages/1_Store Demand Forecasting.py
Browse files
pages/1_Store Demand Forecasting.py
CHANGED
@@ -177,7 +177,7 @@ if option=='TFT':
|
|
177 |
|
178 |
#--------------------------------------------------------------------------------------------------------------
|
179 |
# tabs
|
180 |
-
tab1,tab2
|
181 |
#------------------------------------------------Tab-1-----------------------------------------------------------
|
182 |
tab1.markdown("""
|
183 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
@@ -246,28 +246,28 @@ if option=='TFT':
|
|
246 |
key='download-csv'
|
247 |
)
|
248 |
#--------------------------------Tab-3----------------------------------------------
|
249 |
-
tab3.markdown("""
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
train_a=train_dataset.loc[(train_dataset['store']==store) & (train_dataset['item']==item)][['date','store','item','sales']]
|
267 |
-
test_a=test_dataset.loc[(test_dataset['store']==store) & (test_dataset['item']==item)][['date','store','item','sales']]
|
268 |
-
actual_final_data=pd.concat([train_a,test_a])
|
269 |
-
actual_final_data['date']=actual_final_data['date'].dt.date
|
270 |
-
tab3.dataframe(actual_final_data,width=500)
|
271 |
|
272 |
except:
|
273 |
st.sidebar.error('Model Not Loaded successfully!',icon="🚨")
|
@@ -397,7 +397,7 @@ elif option=='Prophet':
|
|
397 |
st.dataframe(pd.DataFrame({"KPI":['RMSE','MAE'],"Prophet":[rmse,mae]}).set_index('KPI'),width=300)
|
398 |
|
399 |
#---------------------------------------Tabs-----------------------------------------------------------------------
|
400 |
-
tab1,tab2
|
401 |
#-------------------------------------------Tab-1=Forecast plot---------------------------------------------------
|
402 |
tab1.markdown("""
|
403 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
@@ -477,18 +477,18 @@ elif option=='Prophet':
|
|
477 |
)
|
478 |
|
479 |
#------------------------------------------Tab-3--------------------------------------------------
|
480 |
-
train_a=fb_train_data.loc[fb_train_data[item]==1][['ds','sales']]
|
481 |
-
# train_a['store']=1
|
482 |
-
# train_a['item']=item
|
483 |
-
test_a=fb_test_data.loc[fb_test_data[item]==1][['ds','sales']]
|
484 |
-
# test_a['store']=1
|
485 |
-
# test_a['item']=item.split('_')[-1]
|
486 |
-
actual_final_data=pd.concat([train_a,test_a])
|
487 |
-
actual_final_data['store']=1
|
488 |
-
actual_final_data['item']=item.split('_')[-1]
|
489 |
-
actual_final_data['ds']=actual_final_data['ds'].dt.date
|
490 |
-
actual_final_data.rename({"ds":'date'},inplace=True)
|
491 |
-
tab3.dataframe(actual_final_data[['date','store','item','sales']],width=500)
|
492 |
|
493 |
|
494 |
|
|
|
177 |
|
178 |
#--------------------------------------------------------------------------------------------------------------
|
179 |
# tabs
|
180 |
+
tab1,tab2=st.tabs(['📈Forecast Plot','🗃Forecast Table']) #tab3-'🗃Actual Table'
|
181 |
#------------------------------------------------Tab-1-----------------------------------------------------------
|
182 |
tab1.markdown("""
|
183 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
|
|
246 |
key='download-csv'
|
247 |
)
|
248 |
#--------------------------------Tab-3----------------------------------------------
|
249 |
+
# tab3.markdown("""
|
250 |
+
# <div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
251 |
+
# <h2 style='font-size: 30px; font-family: Palatino, serif;
|
252 |
+
# letter-spacing: 2px; text-decoration: none;'>
|
253 |
+
# 📈
|
254 |
+
# <span style='background: linear-gradient(45deg, #ed4965, #c05aaf);
|
255 |
+
# -webkit-background-clip: text;
|
256 |
+
# -webkit-text-fill-color: transparent;
|
257 |
+
# text-shadow: none;'>
|
258 |
+
# Actual Dataset
|
259 |
+
# </span>
|
260 |
+
# <span style='font-size: 40%;'>
|
261 |
+
# <sup style='position: relative; top: 5px; color: #ed4965;'></sup>
|
262 |
+
# </span>
|
263 |
+
# </h2>
|
264 |
+
# </div>
|
265 |
+
# """, unsafe_allow_html=True)
|
266 |
+
# train_a=train_dataset.loc[(train_dataset['store']==store) & (train_dataset['item']==item)][['date','store','item','sales']]
|
267 |
+
# test_a=test_dataset.loc[(test_dataset['store']==store) & (test_dataset['item']==item)][['date','store','item','sales']]
|
268 |
+
# actual_final_data=pd.concat([train_a,test_a])
|
269 |
+
# actual_final_data['date']=actual_final_data['date'].dt.date
|
270 |
+
# tab3.dataframe(actual_final_data,width=500)
|
271 |
|
272 |
except:
|
273 |
st.sidebar.error('Model Not Loaded successfully!',icon="🚨")
|
|
|
397 |
st.dataframe(pd.DataFrame({"KPI":['RMSE','MAE'],"Prophet":[rmse,mae]}).set_index('KPI'),width=300)
|
398 |
|
399 |
#---------------------------------------Tabs-----------------------------------------------------------------------
|
400 |
+
tab1,tab2=st.tabs(['📈Forecast Plot','🗃Forecast Table']) #tab3- '🗃Actual Table'
|
401 |
#-------------------------------------------Tab-1=Forecast plot---------------------------------------------------
|
402 |
tab1.markdown("""
|
403 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
|
|
477 |
)
|
478 |
|
479 |
#------------------------------------------Tab-3--------------------------------------------------
|
480 |
+
# train_a=fb_train_data.loc[fb_train_data[item]==1][['ds','sales']]
|
481 |
+
# # train_a['store']=1
|
482 |
+
# # train_a['item']=item
|
483 |
+
# test_a=fb_test_data.loc[fb_test_data[item]==1][['ds','sales']]
|
484 |
+
# # test_a['store']=1
|
485 |
+
# # test_a['item']=item.split('_')[-1]
|
486 |
+
# actual_final_data=pd.concat([train_a,test_a])
|
487 |
+
# actual_final_data['store']=1
|
488 |
+
# actual_final_data['item']=item.split('_')[-1]
|
489 |
+
# actual_final_data['ds']=actual_final_data['ds'].dt.date
|
490 |
+
# actual_final_data.rename({"ds":'date'},inplace=True)
|
491 |
+
# tab3.dataframe(actual_final_data[['date','store','item','sales']],width=500)
|
492 |
|
493 |
|
494 |
|