This project implements and compares advanced time series forecasting models for PJM's hourly energy consumption, including a hybrid Prophet-XGBoost approach.
-
notebooks/1. analysis.ipynb: Exploratory Data Analysis (EDA) and feature engineering.2. prophet II.ipynb: Prophet baseline model with cross-validation and hyperparameter tuning.3. hybrid III.ipynb: Hybrid Prophet + XGBoost model, evaluation, and results.
-
data/: Raw PJME hourly load CSV file. -
utils/: Project utility scripts for data loading, feature engineering, and evaluation. -
output_hybrid_v2/,output_hybrid_v3/,output_prophet_II_v2/: Model outputs, artifacts, and results. -
requirements.txt: Python dependencies.
-
Install dependencies:
pip install -r requirements.txt
-
Run notebooks in order:
- Start with EDA (
1. analysis.ipynb) - Train Prophet baseline (
2. prophet II.ipynb) - Run hybrid modeling (
3. hybrid III.ipynb)
- Start with EDA (
-
Data:
Make surePJME_hourly.csvis in thedata/folder.
This repository includes a .vscode/settings.json file with recommended settings for Visual Studio Code. These settings help ensure a consistent development environment by:
- Setting the Python interpreter to
.venv/bin/python - Adding
./utilsto the Python analysis path - Enabling basic type checking and linting with pylint
- Formatting code on save
- Auto-saving files after a short delay
Using these settings is optional, but recommended for a smoother experience and consistent code style. If you use a different editor, you can ignore this file.
-
EDA:
Visualizes seasonal, weekly, and holiday effects in PJM load data. -
Feature Engineering:
Adds time-based, cyclical, and holiday features for modeling. -
Prophet Model:
Captures trend, seasonality, and holidays. Hyperparameters tuned with Optuna. -
Hybrid Prophet-XGBoost:
XGBoost learns Prophet residuals using engineered features, improving short-term and local accuracy. -
Evaluation:
MAPE and visual comparisons across monthly and rolling windows.
- The hybrid model reduces MAPE by ~40% compared to Prophet alone.
- Hybrid forecasts better capture local fluctuations and the true shape of the load curve.
- archive/: Place experimental or deprecated files here.
- utils/: Contains reusable code for data processing and evaluation.
- Notebooks are the main workflow; scripts can be modularized as needed.
- PJM Hourly Load Data
- Facebook Prophet
- XGBoost
Acknowledgement:
AI tools were used to assist with markdown formatting, code refactoring, and improvement suggestions. All final implementation, analysis, and decisions are my own.