I am wanting to predict 30 days in the future a time series forecast using LightGBM. I have looked through many tutorials and youtube videos and have not seen anyone actually use the model to forecast the future. The tutorials and videos always end at the forecast comparing the testing target value against the predicted target value.
Below you can find my code that produces the model:
def train_time_series(df_prepared, horizon=90):
X = df_prepared.drop(['incoming_calls'], axis=1)
y = df_prepared['incoming_calls']
X_train, X_test = X.iloc[:-horizon,:], X.iloc[-horizon:,:]
y_train, y_test = y.iloc[:-horizon], y.iloc[-horizon:]
model = LGBMRegressor(random_state=42)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
mae = np.round(np.mean(np.abs(predictions - y_test)),3)
rmse = np.round(np.mean((predictions - y_test)**2)**0.5,3)
mape = np.round(np.mean((predictions - y_test)/y_test),3)
fig = plt.figure(figsize=(16,8))
plt.title(f'Prediction vs. Real - MAE {mae} - RMSE {rmse} - MAPE {mape}', fontsize=16)
plt.plot(y_test, color='red')
plt.plot(pd.Series(predictions, index=y_test.index), color='green')
plt.xlabel('Date', fontsize=16)
plt.ylabel('Number of Incoming Calls', fontsize=16)
plt.legend(labels=['Real', 'Prediction'], fontsize=16)
plt.grid()
plt.show()
train_time_series(df_prepared)
The last day of the data set is 10/17/2019. I would like to forecast and graph the next 30 days of incoming calls.
Thank you for any help.