kaxap commited on
Commit
6d67887
·
1 Parent(s): f5fbb17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -54,9 +54,6 @@ def train_and_forecast(
54
  df.sort_index(inplace=True)
55
  except AttributeError:
56
  raise gr.Error("Upload a file with the Upload button")
57
- print(df)
58
- for i in range(prediction_length//2):
59
- df.loc[len(df.index)] = [f'predict_{i}', 0.0]
60
 
61
  row_offset = offset_calculation(prediction_length, rolling_windows, len(df))
62
  # prediction_length += int(len(df) * 0.1)
@@ -64,7 +61,7 @@ def train_and_forecast(
64
  gluon_df = PandasDataset(df, target=df.columns[0])
65
  except TypeError:
66
  freq = pd.infer_freq(df.index[:3])
67
- date_range = pd.date_range(df.index[0], df.index[-1], freq=freq)
68
  new_df = df.reindex(date_range)
69
  gluon_df = PandasDataset(new_df, target=new_df.columns[0], freq=freq)
70
 
 
54
  df.sort_index(inplace=True)
55
  except AttributeError:
56
  raise gr.Error("Upload a file with the Upload button")
 
 
 
57
 
58
  row_offset = offset_calculation(prediction_length, rolling_windows, len(df))
59
  # prediction_length += int(len(df) * 0.1)
 
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
  gluon_df = PandasDataset(new_df, target=new_df.columns[0], freq=freq)
67