Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,14 +57,14 @@ def train_and_forecast(
|
|
57 |
|
58 |
row_offset = offset_calculation(prediction_length, rolling_windows, len(df))
|
59 |
# prediction_length += int(len(df) * 0.1)
|
60 |
-
try:
|
61 |
-
|
62 |
-
except TypeError:
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
|
69 |
training_data, test_gen = split(gluon_df, offset=row_offset)
|
70 |
|
|
|
57 |
|
58 |
row_offset = offset_calculation(prediction_length, rolling_windows, len(df))
|
59 |
# prediction_length += int(len(df) * 0.1)
|
60 |
+
# try:
|
61 |
+
# gluon_df = PandasDataset(df, target=df.columns[0])
|
62 |
+
# except TypeError:
|
63 |
+
freq = pd.infer_freq(df.index[:3])
|
64 |
+
date_range = pd.date_range(df.index[0], pd.DateOffset(months=prediction_length//2) + df.index[-1], freq=freq)
|
65 |
+
new_df = df.reindex(date_range)
|
66 |
+
print(new_df)
|
67 |
+
gluon_df = PandasDataset(new_df, target=new_df.columns[0], freq=freq)
|
68 |
|
69 |
training_data, test_gen = split(gluon_df, offset=row_offset)
|
70 |
|