Research · Oct 2026 · interactive
Does knowing where the sun is help forecast Delhi's demand?
Rooftop solar is not metered, but it lowers the demand the grid sees in the middle of the day. My SIPCOV-2026 paper uses the sun's position as a stand-in for it. The paper's data and code are not public, so this reruns the idea in the open: the public Delhi data of the LSTM page, the same test year and forecast windows, with and without the sun.
- Best: LightGBM, 5–60 min ahead
- 0.87%
- LSTM, same windows
- 1.06%
- MAPE change with sun, LightGBM
- −0.001 pts
- MAPE change with sun, linear
- −0.026 pts
Try it
Loading…
- Actual demand
- Sun elevation over Delhi, computed from date and time
Each line is the forecast made an hour earlier for every five-minute step of the day. Forecasts were computed once by the training script on the 2024 test year, which no model saw.
Results
| Metric | Value | Source |
|---|---|---|
| LightGBM, calendar + weather + sun | 0.87% · 1.29% · 42 MW | public/projects/solar/explorer.json |
| LightGBM, calendar + weather | 0.87% · 1.28% · 42 MW | public/projects/solar/explorer.json |
| LSTM (its inputs include the sun) | 1.06% · 1.59% · 50 MW | public/projects/solar/explorer.json |
| Linear (ridge), calendar + weather + sun | 1.49% · 2.35% · 70 MW | public/projects/solar/explorer.json |
| Linear (ridge), calendar + weather | 1.51% · 2.38% · 71 MW | public/projects/solar/explorer.json |
| Persistence: the last reading, held | 2.70% · 4.57% · 128 MW | public/projects/solar/explorer.json |
| Same time yesterday | 6.30% · 6.27% · 304 MW | public/projects/solar/explorer.json |
Values: MAPE over all 12 steps (5 to 60 minutes ahead) · MAPE at 60 minutes · mean absolute error, on the same 2,766 hourly forecast origins of 2024 for every model.
What it shows
Trees beat the LSTM, as in the paper. LightGBM reaches 0.87% against the LSTM's 1.06% on the same windows, from features built out of the same 24 hours of history.
For trees, the sun adds nothing the calendar does not already say. LightGBM scores 0.87% without the sun features and 0.87% with them. Hour of day and day of year fix where the sun is, and trees can learn that mapping on their own. A linear model cannot build that curve from sines and cosines, and there the sun features do help a little: 1.51% to 1.49%. But the gain is not in daylight hours (0.00 points there), so it reads as a better daily curve for the linear model, not as a solar effect.
Not the paper's number. The paper reports 0.77% MAPE on its own 18 months of data and setup. These results use different data and should not be compared with it; what carries over is the method and the ranking of the models.
Where the error is
- LightGBM, with sun
- LightGBM, calendar only
- LSTM
- Average sun elevation
How it works
Same problem as the LSTM. At each origin, load and weather are known up to five minutes before it; forecast the next 12 five-minute steps. Same five-minute grid, gap handling and breaks at impossible jumps, same 2024 test year.
Features. From the previous 24 hours only: the last load, its changes over the last 5 minutes to 4 hours, the 1-hour and 24-hour means, the load at the target time yesterday and how it moved from now to then, temperature, humidity and the temperature trend. From the calendar at the target time: hour, weekday and day of year, as sines and cosines. The sun group adds the sine of the sun's elevation at the target time and its change since the last reading.
Models. One model per horizon predicts the change from the last reading. Ridge regression (alpha 1) on standardised features. LightGBM with 63 leaves and learning rate 0.05; its number of trees per horizon is set by early stopping on 2023 while training on the years before, then the model is refit on all training years. The LSTM is the one on its own page, run through the same ONNX file the browser uses.
Reproduce
- Hardware
- Intel64 Family 6 Model 154 Stepping 3, GenuineIntel, CPU, LightGBM 4.7.0
- Commit
- c009e6d
- Data
- Delhi 5-Minute Electricity Demand for Forecasting, CC BY 4.0
Environment
pip install numpy scikit-learn lightgbm onnxruntime torch kaggleData
kaggle datasets download yug201/delhi-5-minute-electricity-demand-for-forecasting -p training/data/delhi --unzipLSTM first (its ONNX file is compared here)
python training/lstm_load/train.pyRun the comparison
python training/solar_forecast/train.pyData: Delhi 5-Minute Electricity Demand for Forecasting by yug201 on Kaggle, licensed CC BY 4.0.