This repository implements forecasting for electrical signals: both consumption (load) and photovoltaic (solar) production. Models include classical ML and deep learning approaches to predict short-term horizons.
The initial goal was to forecast the next timestep (t+15 minutes) and the next 8 timesteps (t+2 hours). During development we found data are not collected in real time but consolidated once per day (before midnight). Therefore the problem was reframed: use the previous day's consolidated data as input to predict the required horizons.
- Data loaders and preprocessing for time-series (windowing, scaling).
- Multiple model families: XGBoost, KNN, MLP, GRU, CNN-GRU, Transformer.
- Training, early stopping, learning rate scheduling.
- Rolling/expanding window cross-validation and k-fold helpers.
- Prediction, denormalization and standardized metrics (MAE, MAPE, RMSE, NRMSE).
- Visualization scripts for predictions and evaluation.
- Clone the repository: git clone https://github.com/BricePetit/AIEG_Forecasting
- Create and activate a Python 3.10+ venv: python -m venv .venv source .venv/bin/activate
- Install dependencies: pip install -r requirements.txt
- src/ : source code (data, models, training, evaluation).
- src/saved_models/ : saved model checkpoints (ignored by git).
- data/ : raw and processed datasets (ignored by git).
- notebooks/ : exploratory notebooks.
- plots/ : figures and diagnostics (ignored by git).
- Prepare dataset with src/data loaders or provided scripts.
- Train a model using training scripts in src/ (e.g. GRU, Transformer).
- Evaluate using expanding window or k-fold utilities.
Standard metrics are provided: MAE, MAPE, MSE, RMSE, NRMSE. Predictions are denormalized before scoring when scalers are available.
- Because input uses daily consolidated snapshots, align modeling and operational expectations with the daily cadence.
- Consider additional exogenous features (weather forecasts, calendar) to improve day-ahead predictions.
- Use rolling/expanding validation to reflect temporal data leakage constraints.
- Open issues for bugs or feature requests.
- Submit PRs with clear descriptions and tests.
- Follow code formatting (black/flake8 recommended).
MIT
See repository metadata for authors and contact details.