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,tab3=st.tabs(['📈Forecast Plot','🗃Forecast Table','🗃Actual
|
181 |
#------------------------------------------------Tab-1-----------------------------------------------------------
|
182 |
tab1.markdown("""
|
183 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
@@ -263,8 +263,10 @@ if option=='TFT':
|
|
263 |
</h2>
|
264 |
</div>
|
265 |
""", unsafe_allow_html=True)
|
266 |
-
|
267 |
-
|
|
|
|
|
268 |
|
269 |
except:
|
270 |
st.sidebar.error('Model Not Loaded successfully!',icon="🚨")
|
@@ -394,7 +396,7 @@ elif option=='Prophet':
|
|
394 |
st.dataframe(pd.DataFrame({"KPI":['RMSE','MAE'],"Prophet":[rmse,mae]}).set_index('KPI'),width=300)
|
395 |
|
396 |
#---------------------------------------Tabs-----------------------------------------------------------------------
|
397 |
-
tab1,tab2=st.tabs(['📈Forecast Plot','🗃Forecast Table'])
|
398 |
#-------------------------------------------Tab-1=Forecast plot---------------------------------------------------
|
399 |
tab1.markdown("""
|
400 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
@@ -472,6 +474,21 @@ elif option=='Prophet':
|
|
472 |
"text/csv",
|
473 |
key='download-csv'
|
474 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
475 |
except:
|
476 |
st.sidebar.error('Model Not Loaded successfully!',icon="🚨")
|
477 |
|
|
|
177 |
|
178 |
#--------------------------------------------------------------------------------------------------------------
|
179 |
# tabs
|
180 |
+
tab1,tab2,tab3=st.tabs(['📈Forecast Plot','🗃Forecast Table','🗃Actual Table'])
|
181 |
#------------------------------------------------Tab-1-----------------------------------------------------------
|
182 |
tab1.markdown("""
|
183 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
|
|
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 |
+
tab3.dataframe(actual_final_data,width=500)
|
270 |
|
271 |
except:
|
272 |
st.sidebar.error('Model Not Loaded successfully!',icon="🚨")
|
|
|
396 |
st.dataframe(pd.DataFrame({"KPI":['RMSE','MAE'],"Prophet":[rmse,mae]}).set_index('KPI'),width=300)
|
397 |
|
398 |
#---------------------------------------Tabs-----------------------------------------------------------------------
|
399 |
+
tab1,tab2,tab3=st.tabs(['📈Forecast Plot','🗃Forecast Table','🗃Actual Table'])
|
400 |
#-------------------------------------------Tab-1=Forecast plot---------------------------------------------------
|
401 |
tab1.markdown("""
|
402 |
<div style='text-align: left; margin-top:-10px;margin-bottom:-10px;'>
|
|
|
474 |
"text/csv",
|
475 |
key='download-csv'
|
476 |
)
|
477 |
+
|
478 |
+
#------------------------------------------Tab-3--------------------------------------------------
|
479 |
+
train_a=fb_train_data.loc[fb_train_data[item]==1][['date','y']]
|
480 |
+
train_a['store']=1
|
481 |
+
train_a['item']=item
|
482 |
+
train_a.rename({'y':'sales'})
|
483 |
+
test_a=fb_test_data.loc[fb_test_data[item]==1][['date','y']]
|
484 |
+
test_a['store']=1
|
485 |
+
test_a['item']=item
|
486 |
+
test_a.rename({'y':'sales'})
|
487 |
+
actual_final_data=pd.concat([train_a,test_a])
|
488 |
+
tab3.dataframe(actual_final_data,width=500)
|
489 |
+
|
490 |
+
|
491 |
+
|
492 |
except:
|
493 |
st.sidebar.error('Model Not Loaded successfully!',icon="🚨")
|
494 |
|