Spaces:
Runtime error
Runtime error
bug fix
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ with open('data/parameters.pkl', 'rb') as f:
|
|
62 |
model = TemporalFusionTransformer.load_from_checkpoint('model/tft_check.ckpt', map_location=torch.device('cpu'))
|
63 |
|
64 |
df = pd.read_pickle('data/test_data.pkl')
|
65 |
-
df = df.loc[(df["Branch"] == 15) & (df["Group"].isin(["6","7","4","1"]))]
|
66 |
|
67 |
rain_mapping = {
|
68 |
"Yes" : 1,
|
@@ -121,10 +121,10 @@ st.pyplot(fig)
|
|
121 |
st.button("Forecast Sales", type="primary") #on_click=None,
|
122 |
|
123 |
# %%
|
124 |
-
preds = raw_preds_to_df(out, quantiles = None)
|
125 |
|
126 |
-
preds = preds.merge(data_selected[['time_idx','Group','Branch','sales','weight','Date','MTXWTH_Day_precip','MTXWTH_Temp_max','MTXWTH_Temp_min']],how='left',left_on=['pred_idx','Group','Branch'],right_on=['time_idx','Group','Branch'])
|
127 |
-
preds.rename(columns={'time_idx_x':'time_idx'},inplace=True)
|
128 |
-
preds.drop(columns=['time_idx_y'],inplace=True)
|
129 |
|
130 |
|
|
|
62 |
model = TemporalFusionTransformer.load_from_checkpoint('model/tft_check.ckpt', map_location=torch.device('cpu'))
|
63 |
|
64 |
df = pd.read_pickle('data/test_data.pkl')
|
65 |
+
df = df.loc[(df["Branch"] == "15") & (df["Group"].isin(["6","7","4","1"]))]
|
66 |
|
67 |
rain_mapping = {
|
68 |
"Yes" : 1,
|
|
|
121 |
st.button("Forecast Sales", type="primary") #on_click=None,
|
122 |
|
123 |
# %%
|
124 |
+
#preds = raw_preds_to_df(out, quantiles = None)
|
125 |
|
126 |
+
#preds = preds.merge(data_selected[['time_idx','Group','Branch','sales','weight','Date','MTXWTH_Day_precip','MTXWTH_Temp_max','MTXWTH_Temp_min']],how='left',left_on=['pred_idx','Group','Branch'],right_on=['time_idx','Group','Branch'])
|
127 |
+
#preds.rename(columns={'time_idx_x':'time_idx'},inplace=True)
|
128 |
+
#preds.drop(columns=['time_idx_y'],inplace=True)
|
129 |
|
130 |
|