Regression · Energy · Streamlit
Solar Power Generation Prediction
Predicting a solar installation's power output from weather conditions, so a grid operator can plan supply and storage ahead of time.
- 0.905R² on test set
- 0.8555-fold CV R²
- 8models compared
- 243tuning configs searched
The problem
Solar output swings with sun angle, cloud cover and humidity. Under-forecasting means paying for unneeded backup power; over-forecasting means buying expensive power at short notice.
The data
2,920 three-hour periods with nine weather features (distance to solar noon, temperature, wind, sky cover, visibility, humidity, pressure) and the power generated.
Approach
Cleaning and EDA
Missing values and outliers treated; distance to solar noon (r = −0.75) and humidity (r = −0.52) have the strongest relationships.
Model comparison
Eight regressors on a 70/30 split.
Tuning
GridSearchCV over 243 Gradient Boosting configurations with 5-fold CV.
Deployment
A Streamlit app that takes weather inputs and returns predicted output.
What I found
- Tuned Gradient Boosting explains about 90% of the variance on unseen data (RMSE ≈ 3,054 J).
- Cross-validated R² of 0.855 is the more honest estimate; one fold scores 0.77, so performance varies with the weather pattern.
The key insight
I report the cross-validated score alongside the single test split, because one lucky split can overstate how a model will perform in production.
Limitations & next steps
- A time-based split would better reflect real forecasting than a random split.
- Next: use weather-forecast inputs for a true day-ahead forecast and compare against a persistence baseline.