Closed slavakurilyak closed 6 years ago
No. You need add a new row after you read csv file to predict the future. Something like this:
# Add next row
last_timestamp = df['Timestamp'].iloc[-1]
if settings.PERIOD == 'Hourly':
next_timestamp = last_timestamp + 3600
df_next = pd.DataFrame([next_timestamp], columns=['Timestamp'])
df = df.append(df_next, ignore_index=True)
df.iloc[-1] = df.iloc[-1].fillna(1)
Then you can use split_df() with settings.NTESTS = 1.
You can check a new notebook 'XGBoost_next_row'.
I'm trying to predict the next row in the dataframe. Please correct me if I'm wrong.