Energy Grid Crystal Ball? See How AI Predicts Usage with Startling Precision

Home / Projects Single Page

Image

The One Simple Feature That Dominates Energy Forecasting

This notebook establishes a baseline for hourly PJM East energy consumption forecasting (2002-2018) by training an XGBoost model using only calendar-derived features like hour, day of week, and month. After preparing the data and performing a chronological train/validation/test split, the model achieved a baseline MAPE of approximately 10.2%. While SHAP analysis confirmed the importance of daily and weekly cycles (hour, day of week), significant errors occurred during holidays and periods of extreme weather, demonstrating the limitations of this feature set and highlighting the need to incorporate weather data, holiday flags, and lagged consumption values for improved accuracy.

To The Top

Image

From 10% to 4% Error: How We Revolutionized Energy Forecasting

This notebook significantly improves upon the baseline calendar-only model for hourly PJM East energy forecasting by incorporating external weather data (temperature, humidity, etc., averaged from nearby stations via Meteostat) and enhanced holiday features (including bridge days and a combined is_dayoff flag) into the XGBoost framework. Following a standard chronological split and training process, the inclusion of these features dramatically boosted performance, reducing the test set MAPE from ~10.2% down to ~3.9% and RMSE from ~3974 MW to ~1540 MW. SHAP analysis revealed that weather variables are now the most influential predictors, followed by the day-off indicator and core calendar cycles, although persistent errors around complex holiday periods suggest further potential gains from adding lagged load features and more refined holiday modeling.

To The Top

Image

The AI Time Series Hack with ARIMA and Deep Learning — Here's the Secret Sauce

ARIMA-LSTM-CNN Hybrid Model for Hourly Energy Forecasting: This hybrid model combines ARIMA for linear trends and seasonal patterns with a deep learning ensemble (LSTM and CNN) to correct nonlinear residuals, achieving a test RMSE of **374.63 MW** and MAPE of **0.89%**—a **72% improvement** over standalone ARIMA. The workflow processes energy and weather data, engineers temporal features, and uses ARIMA to model baseline demand, leaving residuals for the LSTM-CNN network to capture complex interactions (e.g., weather anomalies, holiday rebounds). Evaluation reveals superior accuracy, with worst errors on post-holiday spikes (e.g., July 4th) and best performance on stable off-peak days. Visualizations and error analysis highlight the model’s ability to align closely with actual load curves, while identified weaknesses (e.g., holiday-adjacent days) guide future refinements like lagged features or temperature-driven submodels. This approach effectively bridges statistical rigor and deep learning flexibility for high-precision energy forecasts.

To The Top

Image

TimeXer: Powering PJM Load Forecasts with Transformer Attention

In this notebook, we introduce TimeXer, a unified transformer‐style model that marries endogenous load patching with exogenous weather and calendar embeddings to deliver sub‐5 % one‐day‐ahead forecasts on PJM’s hourly demand data. After loading and engineering rich features, we build custom Positional, TimeFeature, and Token embeddings, stack multi‐head self- and cross-attention layers, and train with early stopping. We then automate hyperparameter search using Optuna’s adaptive sampler and MedianPruner—rapidly zeroing in on an optimal learning rate and sequence length—and ultimately achieve robust test RMSE ≈ 1.95 GW and MAPE ≈ 4.28 %. TimeXer’s ability to align peaks and troughs with minimal bias demonstrates the power of attention mechanisms for grid‐scale forecasting.

To The Top

Take a Chance!

“IN THE END… We only regret the chances we didn’t take, the relationships we were afraid to have,and the decisions we waited too long to make.” ― Lewis Carroll

Download Resume