Ask a question Portal ↗
Home › Docs › Cases

Solar Surplus Forecaster – trained on MareNostrum 5

24-hour solar surplus forecast for a self-consumption PV installation, run under Compute-to-Data.

Cases · BSC AI Factory ~1 min read

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.

MetricValue
R²0.86
MAE0.14 kWh
RMSE0.40 kWh

Input Data

An hourly CSV file with the following columns. 30–60 days of history are recommended.

FieldDescription
info_dt (or timestamp)Hour of the reading.
grid_import_kwhEnergy imported from the grid in that hour, in kWh.
grid_export_kwhEnergy 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.

ParameterDescription
horizon_hoursNumber of hours to forecast.
latitudeLatitude of the installation.
longitudeLongitude of the installation.
installed_kwpInstalled 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.