Circhastic commited on
Commit
008dd16
1 Parent(s): 92daa05

Version 1 hotfix #22 for merge

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -7,7 +7,7 @@ import numpy as np
7
  import pmdarima as pm
8
  import matplotlib.pyplot as plt
9
  from pmdarima import auto_arima
10
- # import plotly.graph_objects as go
11
 
12
  import torch
13
  from transformers import pipeline, TapasTokenizer, TapasForQuestionAnswering
@@ -371,11 +371,14 @@ if (st.session_state.uploaded):
371
  col = st.columns(2)
372
  with col[0]:
373
  col[0].header("Sales Forecast")
374
- # merged_data = plot_data(df['Sales'], fitted_series, future_fitted_series)
375
- # date = get_combined_date(df['Sales'], fitted_series, future_fitted_series)
376
- # col[0].line_chart(x=date, y=[df['Sales'], fitted_series], color='blue', key='actual')
377
  merged_data = merge_forecast_data(df['Sales'], fitted_series, future_fitted_series)
378
- col[0].line_chart(merged_data, x="index", y=["Actual Sales", "Predicted Sales", "Future Forecasted Sales"])
 
 
 
 
 
 
379
  col[0].write(f"MAPE score: {acc['mape']} (lower is better)")
380
  with col[1]:
381
  col[1].subheader(f"Forecasted sales in the next {period} days")
 
7
  import pmdarima as pm
8
  import matplotlib.pyplot as plt
9
  from pmdarima import auto_arima
10
+ import plotly.graph_objects as go
11
 
12
  import torch
13
  from transformers import pipeline, TapasTokenizer, TapasForQuestionAnswering
 
371
  col = st.columns(2)
372
  with col[0]:
373
  col[0].header("Sales Forecast")
 
 
 
374
  merged_data = merge_forecast_data(df['Sales'], fitted_series, future_fitted_series)
375
+
376
+ fig = go.Figure()
377
+ fig.add_trace(go.Scatter(x=merged_data['Date'], y=merged_data['Sales_Actual'], mode='lines', name='Actual Sales'))
378
+ fig.add_trace(go.Scatter(x=merged_data['Date'], y=merged_data['Sales_Predicted'], mode='lines', name='Predicted Sales'))
379
+ fig.add_trace(go.Scatter(x=merged_data['Date'], y=merged_data['Sales_Forecasted'], mode='lines', name='Forecasted Sales'))
380
+ fig.update_layout(title='Forecasted Sales Data', xaxis_title='Date', yaxis_title='Sales')
381
+ col[0].plotly_chart(fig)
382
  col[0].write(f"MAPE score: {acc['mape']} (lower is better)")
383
  with col[1]:
384
  col[1].subheader(f"Forecasted sales in the next {period} days")