Circhastic commited on
Commit
43de9aa
1 Parent(s): caf3172

version 1.1

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -351,7 +351,6 @@ if (st.session_state.uploaded):
351
  future_upper_series = pd.Series(confint[:, 1], index=future_index_of_fc)
352
 
353
  future_sales_growth = sales_growth(df, future_fitted_series)
354
- df = dates_df(future_sales_growth)
355
 
356
  test_y, predictions = np.array(test_y), np.array(fitted)
357
  score = forecast_accuracy(predictions, test_y)
@@ -359,18 +358,12 @@ if (st.session_state.uploaded):
359
 
360
  df = df.set_index('Date')
361
  merged_data = merge_forecast_data(df['Sales'], fitted_series, future_fitted_series)
362
- merged_data_dates = merged_data.copy()
363
- merged_data_dates[merged_data_dates.columns[0]] = pd.to_datetime(merged_data_dates[merged_data_dates.columns[0]])
364
 
365
  col_charts = st.columns(2)
366
 
367
- print(merged_data)
368
  print(merged_data.info)
369
  print(merged_data.dtypes)
370
- print(merged_data[merged_data.columns[0]]) # for debugging
371
- print(merged_data[merged_data.columns[0]].info) # for debugging
372
- print(merged_data_dates[merged_data.columns[0]]) # for debugging
373
- print(merged_data_dates.info)
374
  min_date = merged_data_dates[merged_data_dates.columns[0]].min()
375
  max_date = merged_data_dates[merged_data_dates.columns[0]].max()
376
  with col_charts[0]:
@@ -390,6 +383,8 @@ if (st.session_state.uploaded):
390
  st.plotly_chart(fig_forecast, use_container_width=True)
391
  st.write(f"MAPE score: {mape}% - {interpretation}")
392
 
 
 
393
  col_table = st.columns(2)
394
  with col_table[0]:
395
  col_table[0].subheader(f"Forecasted sales in the next {period} days")
 
351
  future_upper_series = pd.Series(confint[:, 1], index=future_index_of_fc)
352
 
353
  future_sales_growth = sales_growth(df, future_fitted_series)
 
354
 
355
  test_y, predictions = np.array(test_y), np.array(fitted)
356
  score = forecast_accuracy(predictions, test_y)
 
358
 
359
  df = df.set_index('Date')
360
  merged_data = merge_forecast_data(df['Sales'], fitted_series, future_fitted_series)
 
 
361
 
362
  col_charts = st.columns(2)
363
 
364
+ print(merged_data) # debug
365
  print(merged_data.info)
366
  print(merged_data.dtypes)
 
 
 
 
367
  min_date = merged_data_dates[merged_data_dates.columns[0]].min()
368
  max_date = merged_data_dates[merged_data_dates.columns[0]].max()
369
  with col_charts[0]:
 
383
  st.plotly_chart(fig_forecast, use_container_width=True)
384
  st.write(f"MAPE score: {mape}% - {interpretation}")
385
 
386
+ df = dates_df(future_sales_growth)
387
+
388
  col_table = st.columns(2)
389
  with col_table[0]:
390
  col_table[0].subheader(f"Forecasted sales in the next {period} days")