Skip to content

eeshawn11/Time_Series_Forecasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time Series Forecasting with Prophet

Kaggle

Introduction

Singapore has seen much progress in the energy sector, transitioning from the use of oil to natural gas over the past decades and also gradually introducing other alternative sustainable energy sources such as solar. The effects of climate change have become more pronounced and could severely impact our small island state if kept unchecked. With the target of zero net emissions by 2050, the energy sector needs to reduce emissions while ensuring supply keeps pace with the growing demand.

This creates a need for an accurate forecasting model that can accurately predict energy demand over a 365 day forecast horizon. This allows sufficient buffer for planning of new energy infrastructure projects to ensure that future energy demands can be met, ensuring stability of the overall energy network.

Data

Data for this project is scraped from the Energy Market Authority of Singapore statistics for half-hourly system demand data and consolidated into a dataset.

If you would like to try your own scraping from the website, I have included the ema_scraper script. In my case I worked with ChromeDriver, but feel free to change to a different WebDriver of choice by modifying the script.

Data Dictionary

Column Type Description
ds datetime64 Timestamp in 30 minute intervals
y float Historical electricity system demand in MW

Modelling

Prophet is an open source tool released by Facebook for forecasting time series data, and is meant to be straightforward and easy to use. It is based on an additive model where trends are fit with daily, weekly and yearly seasonality, and can also account for holiday effects, which should be very applicable to this use case with electrical demand.

Evaluation

Prophet achieved a 3.67% MAPE when predicting for January 2023, when trained on data from 2017 - 2022.

Plot of prediction

Future Work

While the model appears to have achieved a high fit with our historical data, it is important in time series forecasting to ensure that the model is able to perform well in production. This could involve constantly evaluating the forecasts against the actual demand as time passes, otherwise the high degree of accuracy in predicting historical data could just be our model overfitting to seen data and having low actual forecasting ability.

In a future version of this project, it would be interesting to compare Prophet's performance against other models:

  • Traditional statistical models such as seasonal ARIMA
  • Supervised machine learning algorithms such as XGBoost or LightGBM
  • Deep learning Recurrent Neural Network (RNN)

Recommendations

With the model forecasting that electrical demand may remain approximately the same as in 2022, this could suggest that some of the agency's efforts in reducing energy demand through encouraging energy efficiency has been effective. However, note also that there is a high level of uncertainty given our long prediction horizon. As with most time-series models, the model will need to be retrained often using the latest available data in order to maintain its performance.

References