SunPulse: solar generation estimator (Random Forest)

Estimates hourly solar electricity generation in MW from weather, time and country, for Germany, France, Spain, Italy, Portugal, Greece, Denmark and Belgium. Built for the CT-378 Machine Learning course (NED University).

Intended use

Quick estimates and analysis for energy analysts and students. It is not a grid-management or forecasting-for-trading system and gives no guarantee about real generation.

Model

  • scikit-learn Pipeline: median imputation + standard scaling for numeric inputs, most-frequent imputation + one-hot encoding for country, then RandomForestRegressor (50 trees, min_samples_leaf=3).
  • Inputs (18): temperature, relative humidity, cloud cover, wind speed, surface pressure, shortwave radiation, country, hour, day of week, month, day of year, weekend flag, and sine/cosine encodings of hour, month and day of year. The hour is in UTC.
  • Target: solar_generation_actual (MW).
  • Trained with scikit-learn 1.6.1 (load it with the same version).

Data

Source Use Licence and terms Retrieved
Open Power System Data, time series 2020-10-06 actual solar generation Attribution required; primary data from ENTSO-E Transparency Platform and national TSOs, whose own terms apply 2026-10-30
Open-Meteo Historical Weather API hourly weather (reanalysis-based), one capital-city point per country CC BY 4.0, attribution required, free API for non-commercial use 2026-10-30

350,209 hourly records, 3 October 2015 to 30 September 2020. No personal data.

Attribution: Open Power System Data. 2020. Data Package Time series. Version 2020-10-06. https://doi.org/10.25832/time_series/2020-10-06. Weather data by Open-Meteo.com (CC BY 4.0).

Evaluation

Chronological split 70/15/15 (train/validation/test); models compared on validation, the final model was refitted on train+validation and evaluated once on the held-out test period (Jan to Sep 2020, 52,488 rows).

Metric (test) Value
MAE 424.195 MW
RMSE 1115.253 MW
Rยฒ 0.9242

Validation comparison (MAE, MW): Random Forest 266.4, Decision Tree 292.0, Gradient Boosting 527.3, Linear Regression (baseline) 1402.5.

Test MAE by country (MW): Portugal 50.9, Denmark 58.9, Greece 81.5, Belgium 147.5, Italy 329.7, France 402.8, Spain 1009.7, Germany 1309.6. Compare countries with their own generation level: their scales differ strongly.

Limitations

  • Weather is taken at one capital-city point per country, not a national average.
  • The model was trained on 2015 to 2020 capacity levels and underpredicts the newer, higher-capacity test period on average; Random Forests cannot extrapolate beyond the range seen in training.
  • Spain's reported series has positive generation at night; hourly timestamps of generation and weather may be offset by one hour.
  • Weather in training is reanalysis-based; forecasts used in the apps can differ.
  • The "tree spread" shown in the apps is the disagreement between trees, not a statistical confidence interval.
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using shahzaim/sunpulse-solar-rf 1