tonne commited on
Commit
2ae26f6
1 Parent(s): f0d7454
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -59,7 +59,7 @@ class TS:
59
  fig = go.Figure()
60
  fig.add_trace(go.Scatter(x= data.ds,
61
  y=data.y,
62
- name = f"{self.symbol}_true"
63
  ))
64
  fig.add_trace(go.Scatter(x= future.ds,
65
  y=future.yhat,
@@ -72,13 +72,12 @@ class TS:
72
  model = ARIMA(df.y, order = (1, 0, 7))
73
  model = model.fit()
74
  print(len(df))
75
- future = pd.DataFrame()
76
  predictions = model.forecast(period)
77
- future["y"] = predictions
78
- print(df.index.max())
79
- future.index = pd.date_range(start = df.index.max() + timedelta(days = 1), end = df.index.max() + timedelta(days = period))
80
 
81
- return self.viz(df, future)
82
 
83
 
84
 
 
59
  fig = go.Figure()
60
  fig.add_trace(go.Scatter(x= data.ds,
61
  y=data.y,
62
+ name = f"{self.symbol}"
63
  ))
64
  fig.add_trace(go.Scatter(x= future.ds,
65
  y=future.yhat,
 
72
  model = ARIMA(df.y, order = (1, 0, 7))
73
  model = model.fit()
74
  print(len(df))
75
+ forecast = pd.DataFrame()
76
  predictions = model.forecast(period)
77
+ forecast["y"] = predictions
78
+ forecast["ds"] = pd.date_range(start = df.index.max() + timedelta(days = 1), end = df.index.max() + timedelta(days = period))
 
79
 
80
+ return self.viz(df, forecast)
81
 
82
 
83