Solar Surplus Forecaster – trained on MareNostrum 5
24-hour solar surplus forecast for a self-consumption PV installation, run under Compute-to-Data.
Purpose of the Algorithm
This algorithm forecasts the next 24 hours of solar surplus, the kWh a self-consumption photovoltaic installation exports to the grid. It works from the installation's own hourly grid import/export history, so no extra metering is needed.
How the Model Was Built
- Training: more than 3,000 model configurations were trained on the MareNostrum 5 supercomputer at the Barcelona Supercomputing Center (BSC), and the best one was selected.
- Model: a two-stage Extra Trees model. A classifier first predicts whether there will be a surplus in each hour, then a regressor predicts how much.
- Features: 255 forecast-safe features covering calendar, solar geometry, weather, historical consumption profiles and lags.
Test Performance
Measured on hourly data from December 2025 to May 2026.
| Metric | Value |
|---|---|
| R² | 0.86 |
| MAE | 0.14 kWh |
| RMSE | 0.40 kWh |
Input Data
An hourly CSV file with the following columns. 30–60 days of history are recommended.
| Field | Description |
|---|---|
| info_dt (or timestamp) | Hour of the reading. |
| grid_import_kwh | Energy imported from the grid in that hour, in kWh. |
| grid_export_kwh | Energy exported to the grid in that hour, in kWh. |
Output
- surplus_forecast.csv: the forecast surplus for each hour (
hour,predicted_surplus_kwh). - summary.json: a summary of the forecast.
Optional Parameters
Passed as algoCustomData when the job is started.
| Parameter | Description |
|---|---|
| horizon_hours | Number of hours to forecast. |
| latitude | Latitude of the installation. |
| longitude | Longitude of the installation. |
| installed_kwp | Installed photovoltaic power, in kWp. |
How It Runs
The algorithm is offered as the service Solar surplus 24h forecast, free of charge, and runs under Compute-to-Data. The model goes to the data, so the raw consumption data never leaves the data owner. Only the forecast files are returned.
Who It Is For
- Self-consumption installations: plan consumption and storage around the expected surplus.
- Energy communities: anticipate the surplus available for sharing among members.

