filipeclduarte commited on
Commit
ac2d365
·
1 Parent(s): b3346eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -17,21 +17,24 @@ if uploaded_file is not None:
17
  horizons = int(st.text_input("Write the number of horizons"))
18
  if series is not None:
19
  series_train = pd.DataFrame(
20
- {
21
- 'ds': pd.date_range(start=date, periods=dataframe.shape[0], freq=freq),
22
- 'y': dataframe[series].values
23
- },
24
- index=pd.Index([0] * dataframe.shape[0], name='unique_id')
25
- )
26
 
27
  fig = px.line(series_train, x='ds', y='y', title=f'{series}')
28
  st.plotly_chart(fig)
29
 
30
  fcst = StatsForecast(
31
- series_train,
32
- models=[(auto_arima, 12), (seasonal_naive, 12)],
33
- freq=freq,
34
- n_jobs=1
35
  )
36
  forecasts = fcst.forecast(horizons, level=(80, 95))
37
  st.write(forecasts)
 
 
 
 
17
  horizons = int(st.text_input("Write the number of horizons"))
18
  if series is not None:
19
  series_train = pd.DataFrame(
20
+ {
21
+ 'ds': pd.date_range(start=date, periods=dataframe.shape[0], freq=freq),
22
+ 'y': dataframe[series].values
23
+ },
24
+ index=pd.Index([0] * dataframe.shape[0], name='unique_id')
25
+ )
26
 
27
  fig = px.line(series_train, x='ds', y='y', title=f'{series}')
28
  st.plotly_chart(fig)
29
 
30
  fcst = StatsForecast(
31
+ series_train,
32
+ models=[(auto_arima, 12), (seasonal_naive, 12)],
33
+ freq=freq,
34
+ n_jobs=1
35
  )
36
  forecasts = fcst.forecast(horizons, level=(80, 95))
37
  st.write(forecasts)
38
+ fig.add_scatter(x=forecasts['ds'], y=df['auto_arima_season_length-12_mean'], mode='lines')
39
+ fig.add_scatter(x=forecasts['ds'], y=df['seasonal_naive_season_length-12'], mode='lines')
40
+ st.plotly_chart(fig)