Implementation notes

Project Showcase

Predictive Modeling: Energy Demand Forecasting

Building probabilistic forecasts to optimize grid operations across Portuguese municipalities.

Key Technologies

  • Python Feature engineering and probabilistic modeling with pandas and scikit-learn.
  • Prophet Hierarchical time-series forecasting with external regressors.
  • MLflow Experiment tracking, model registry, and deployment packaging.

GitHub Repository

Forecasting pipeline with reproducible experiments and deployment assets.

Stars
—
Forks
—
Open Issues
—

Live Demo & Visualizations

Problem Statement

Municipal grid operators struggled to anticipate demand spikes during extreme weather events, leading to costly peaker plant activations and service disruptions.

Solution Approach

  • Aggregated smart meter telemetry, weather forecasts, and socioeconomic indicators.
  • Engineered lagged consumption features, holiday flags, and regional mobility indices.
  • Trained gradient boosted decision trees and Prophet ensembles with hyperparameter sweeps.

Results & Findings

The combined ensemble reduced mean absolute percentage error (MAPE) by 18% compared to the incumbent baseline and enabled proactive load shifting programs.

MAPE improvement
18%

Relative to previous autoregressive baseline across validation windows.

Peak demand warning lead time
4 hours

Average actionable notice before critical threshold breaches.

Carbon savings
6.5%

Reduction in emergency peaker usage measured quarter-over-quarter.

Challenges & Lessons Learned

Harmonizing disparate telemetry sampling rates required building a robust temporal alignment service and data quality audit dashboard.

Datasets & Sources

  • Portuguese smart meter telemetry (2021–2023)
  • ECMWF weather ensemble forecasts
  • Municipal census indicators sourced from national statistics offices

Model Performance

Forecast intervals calibrated within ±6% coverage error across municipalities. Residual diagnostics confirmed minimal autocorrelation after differencing and regressor tuning.

Interactive forecast explorer with interval coverage overlays.

Future Work & Improvements

Extend the model to include real-time grid telemetry and reinforcement learning-based demand response optimization.

Collaboration & Contributions

Interested utilities and research partners can open issues or reach out via dfr@esmad.ipp.pt to discuss pilot deployments.

How to cite

Use the quick export buttons to save citations for reference managers or copy the formatted text directly.

Diogo Ribeiro (2026). Predictive Modeling: Energy Demand Forecasting. DataLog | Data Science & Research Theme. https://diogoribeiro7.github.io/analytics-blog-jekyll/portfolio/predictive-modeling-energy-demand/.

BibTeX

RIS

EndNote

Open science & reproducibility badges

These badges highlight the transparency practices applied to this work. Hover or focus on each badge to learn more about the criteria.

  • Open Data Dataset and code repository published with permissive license. Public repository, DOI issued, README with reproduction steps.
  • Reproducible Workflow Containerized environment and automated tests provided. Continuous integration pipeline with reproducibility checks.
  • Transparent Peer Review Peer review reports archived with DOI and linked to article. Open peer review statement and archived reports on Zenodo.

Implementation notes

  • Time-series cross-validation configured with rolling windows and seasonality-aware folds.
  • Feature importance tracked via SHAP to guide stakeholder communication.
  • Deployment packaged as containerized batch jobs triggered by Prefect flows.
Loading mathematical content